-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Namespacing and isolating engine. Include documentation to mount and …
…run tests. Using named route in helper partial. Including helper on init. Upgrading Ruby from 2.5.3 > 2.7.3. Upgrading Rubocop and linting accordingly.
- Loading branch information
Showing
20 changed files
with
107 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.5.3 | ||
2.7.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
$LOAD_PATH.push File.expand_path("lib", __dir__) | ||
$LOAD_PATH.push File.expand_path('lib', __dir__) | ||
|
||
# Maintain your gem's version: | ||
require "abraham/version" | ||
require 'abraham/version' | ||
|
||
# Describe your gem and declare its dependencies: | ||
Gem::Specification.new do |s| | ||
s.name = "abraham" | ||
s.name = 'abraham' | ||
s.version = Abraham::VERSION | ||
s.authors = ["Jonathan Abbett"] | ||
s.email = ["[email protected]"] | ||
s.homepage = "https://github.com/actmd/abraham" | ||
s.summary = "Trackable application tours for Rails with i18n support, based on Shepherd.js." | ||
s.description = "Trackable application tours for Rails with i18n support, based on Shepherd.js." | ||
s.license = "MIT" | ||
s.authors = ['Jonathan Abbett'] | ||
s.email = ['[email protected]'] | ||
s.homepage = 'https://github.com/actmd/abraham' | ||
s.summary = 'Trackable application tours for Rails with i18n support, based on Shepherd.js.' | ||
s.description = 'Trackable application tours for Rails with i18n support, based on Shepherd.js.' | ||
s.license = 'MIT' | ||
|
||
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] | ||
s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] | ||
|
||
s.add_development_dependency 'sassc-rails' | ||
s.add_development_dependency 'sqlite3' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
class Abraham::HistoriesController < ApplicationController | ||
def create | ||
abraham_history = Abraham::History.new(abraham_history_params).tap do |history| | ||
history.creator_id = current_user.id | ||
end | ||
|
||
respond_to do |format| | ||
if abraham_history.save | ||
format.json { render json: abraham_history, status: :created } | ||
else | ||
format.json { render json: abraham_history.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
private | ||
|
||
def abraham_history_params | ||
params.require(:history).permit(:controller_name, :action_name, :tour_name) | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/models/application_record.rb → app/models/abraham/application_record.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationRecord < ActiveRecord::Base | ||
class Abraham::ApplicationRecord < ActiveRecord::Base | ||
self.abstract_class = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class Abraham::History < ApplicationRecord | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
Rails.application.routes.draw do | ||
resources :abraham_histories, only: :create | ||
Abraham::Engine.routes.draw do | ||
resources :histories, only: :create | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
require "abraham/engine" | ||
require 'abraham/engine' | ||
|
||
module Abraham | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rubygems" | ||
class Abraham::Engine < ::Rails::Engine | ||
isolate_namespace Abraham | ||
|
||
module Abraham | ||
class Engine < ::Rails::Engine | ||
ActiveSupport.on_load(:action_controller_base) do | ||
helper AbrahamHelper | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Abraham | ||
VERSION = "2.4.0" | ||
VERSION = '2.4.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/dummy/test/controllers/abraham/histories_controller_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
module Abraham | ||
class HistoriesControllerTest < ActionDispatch::IntegrationTest | ||
test 'creates Abraham::History' do | ||
assert_difference ['Abraham::History.count'] do | ||
post abraham.histories_url, as: :json, params: { history: { action_name: 'foo', controller_name: 'bar', tour_name: 'baz' } } | ||
end | ||
end | ||
end | ||
end |
11 changes: 0 additions & 11 deletions
11
test/dummy/test/controllers/abraham_histories_controller_test.rb
This file was deleted.
Oops, something went wrong.