This commit is contained in:
Jonathan Abbett 2016-12-19 23:37:03 -05:00
parent 8908dcc755
commit 182c749a5a
11 changed files with 47 additions and 17 deletions

View File

@ -1 +1 @@
2.3.2
2.3.3

View File

@ -14,3 +14,6 @@ gemspec
# To use a debugger
# gem 'byebug', group: [:development, :test]
# Avoid the 'multiple sources' confusion
gem 'rails-assets-tether', :source => 'http://rails-assets.org/'

View File

@ -4,6 +4,7 @@ PATH
abraham (1.0.0)
jquery-rails
rails (~> 5.0.0, >= 5.0.0.1)
rails-assets-js-cookie (~> 2.1)
rails-assets-shepherd.js (~> 1.8)
sass-rails (~> 5.0)
@ -51,7 +52,7 @@ GEM
arel (7.1.4)
ast (2.3.0)
builder (3.2.2)
concurrent-ruby (1.0.2)
concurrent-ruby (1.0.3)
erubis (2.7.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
@ -69,7 +70,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.1)
minitest (5.10.1)
nio4r (1.2.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
@ -91,9 +92,10 @@ GEM
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.0.1)
sprockets-rails (>= 2.0.0)
rails-assets-js-cookie (2.1.3)
rails-assets-shepherd.js (1.8.1)
rails-assets-tether (>= 1.0.1, < 2)
rails-assets-tether (1.3.7)
rails-assets-tether (1.4.0)
rails-dom-testing (2.0.1)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
@ -106,7 +108,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.1.0)
rake (11.3.0)
rake (12.0.0)
rubocop (0.45.0)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
@ -129,7 +131,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.12)
thor (0.19.1)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.5)
tzinfo (1.2.2)
@ -144,6 +146,7 @@ PLATFORMS
DEPENDENCIES
abraham!
rails-assets-tether!
rubocop
sqlite3

View File

@ -29,10 +29,10 @@ $ bundle install
$ rails generate abraham:install
```
Require Shepherd.js in `app/assets/javascripts/application.js`
Require `abraham` in `app/assets/javascripts/application.js`
```
//= require shepherd.js.js
//= require abraham
```
Require a Shepherd.js CSS theme in `app/assets/stylesheets/application.scss`
@ -117,3 +117,11 @@ Abraham takes care of which buttons should appear with each step:
### Testing your tours
Abraham loads tour definitions once when you start your server. Restart your server to see tour changes.
If you'd like to run JavaScript integrations tests without the Abraham tours getting in the way, clear the Abraham configuration in your test helper, e.g.
```
Rails.application.configure do
config.abraham.tours = {}
end
```

View File

@ -10,9 +10,9 @@ Gem::Specification.new do |s|
s.version = Abraham::VERSION
s.authors = ['Jonathan Abbett']
s.email = ['jonathan@act.md']
s.homepage = 'http://getabraham.com'
s.summary = 'Trackable application tours for Rails with i18n support.'
s.description = 'Guide your users in the one true path.'
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']
@ -20,6 +20,7 @@ Gem::Specification.new do |s|
s.add_dependency 'rails', '~> 5.0.0', '>= 5.0.0.1'
s.add_dependency 'sass-rails', '~> 5.0'
s.add_dependency 'rails-assets-shepherd.js', '~> 1.8'
s.add_dependency 'rails-assets-js-cookie', '~> 2.1'
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'rubocop'

View File

@ -0,0 +1,10 @@
//= require jquery
//= require jquery_ujs
//= require js-cookie
//= require tether
//= require shepherd.js.js
$(document).on('turbolinks:before-cache', function() {
// Remove visible product tours
$(".shepherd-step").remove();
});

View File

@ -20,6 +20,10 @@
});
});
tour.on("cancel", function() {
Cookies.set('abraham-<%= controller_name %>-<%= action_name %>-<%= tour_name %>', 'later');
});
<% steps.each_with_index do |(key, step), index| %>
tour.addStep('step-<%= key %>', {
<% if step.key?('title') %>
@ -45,5 +49,8 @@
});
<% end %>
// Don't start the tour if the user dismissed it once this session
if (!Cookies.get('abraham-<%= controller_name %>-<%= action_name %>-<%= tour_name %>')) {
tour.start();
}
</script>

View File

@ -2,6 +2,7 @@
require 'rubygems'
require 'rails-assets-shepherd.js'
require 'jquery-rails'
require 'rails-assets-js-cookie'
module Abraham
class Engine < ::Rails::Engine

View File

@ -1,4 +1,4 @@
# frozen_string_literal: true
module Abraham
VERSION = '1.0.0'
VERSION = '1.1.0'
end

View File

@ -10,8 +10,5 @@
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require tether
//= require shepherd.js.js
//= require abraham
//= require_tree .

Binary file not shown.