bookends 2.1.3 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d9bba56928ab576b2e73f0012146de3eef1adfd
4
- data.tar.gz: 2a95d2a30bf73f094d425f5d81142563d619d5fc
3
+ metadata.gz: 11e7990788a93bca1d6d1cfea3baca8b0e04a76f
4
+ data.tar.gz: d3c545da7fee2528575aabd4f1b50da12aad02a9
5
5
  SHA512:
6
- metadata.gz: f16f292879667ba35be104795127c555cd02e32377a4b0927b83d75871f91adc8cd6fe438d134fe2aa1607cf73a534fd4988ee271f768866454a8d60e2c2fbab
7
- data.tar.gz: ef1a723abe111751cd5801129690f5e677a03ac3a5571eb106b33631f246a9311e2042cf9802c4c92669fee23d90b2f76aeec00f4f4391668ab73bb0ecbe9243
6
+ metadata.gz: ee1b556345ab4f91d37750959157925b9d88b3cd6a9a17a7dd6000a72e0046fbc6ff4fcd4b8f070d887d59cced26eef552013a494560f5be032bfadba208fb90
7
+ data.tar.gz: 8738d2b46dcc1887a84e2cbc5aea98a40c7cdc3589af49feee536b1cd4b4919e8504b868e16fc3d7666d222510539dc33b9e3bded84fd5694e3a7800ace0773e
data/README.md CHANGED
@@ -55,7 +55,7 @@ See all rake tasks with `rake -T`
55
55
 
56
56
  #### Jekyll version
57
57
  1. `gem install bookends --local ../bookends/pkg/bookends-<latest_pkg>` from the
58
- root of the Jekyll project.
58
+ root of the Jekyll project.
59
59
  * Run `rake build` from bookends if there are no `*.gem` files in
60
60
  `bookends/pkg/`
61
61
  2. `bundle install` from the Jekyll application
@@ -4,6 +4,7 @@ require 'ostruct'
4
4
 
5
5
  require_relative 'rails_handler'
6
6
  require_relative 'jekyll_handler'
7
+ require_relative 'flag_handler'
7
8
  require_relative 'config/framework'
8
9
  require_relative 'config/turbolinks'
9
10
 
@@ -12,16 +13,26 @@ module Bookends
12
13
  at_exit { puts "\nThank you for using Bookends v#{Bookends::VERSION}" }
13
14
  @@post_install_messages = ["\n", "\n"]
14
15
 
15
- desc "install", "installs bookends"
16
+ desc "install", "Installs bookends"
17
+ option :app
16
18
  def install
17
- ask_for_framework
18
- ask_about_turbolinks if rails?
19
+ ask_about_app unless valid_app_flag?
19
20
  move_files
20
21
  puts @@post_install_messages
21
22
  end
22
23
 
23
-
24
24
  private
25
+ def valid_app_flag?
26
+ return false unless options[:app]
27
+
28
+ Bookends::FlagHandler.handle_app_flag(options[:app], config)
29
+ end
30
+
31
+ def ask_about_app
32
+ ask_for_framework
33
+ ask_about_turbolinks if rails?
34
+ end
35
+
25
36
  def move_files
26
37
  self.send "handle_#{config.framework.get}"
27
38
  end
@@ -0,0 +1,17 @@
1
+ module Bookends::FlagHandler
2
+ extend self
3
+
4
+ def handle_app_flag(app, config)
5
+ has_valid_app_flag = true
6
+
7
+ case app.downcase.strip
8
+ when 'www' then config.framework.set(:rails); config.turbolinks.set(false)
9
+ when 'blog' then config.framework.set(:rails); config.turbolinks.set(false)
10
+ when 'elements' then config.framework.set(:rails); config.turbolinks.set(true)
11
+ when 'engineering' then config.framework.set(:jekyll); config.turbolinks.set(false)
12
+ else has_valid_app_flag = false
13
+ end
14
+
15
+ has_valid_app_flag
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Bookends
2
- VERSION = "2.1.3"
2
+ VERSION = "2.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookends
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marketing Web Ops at heroku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-04 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -221,6 +221,7 @@ files:
221
221
  - lib/bookends/config/turbolinks.rb
222
222
  - lib/bookends/engine.rb
223
223
  - lib/bookends/file_actions.rb
224
+ - lib/bookends/flag_handler.rb
224
225
  - lib/bookends/jekyll_handler.rb
225
226
  - lib/bookends/rails_handler.rb
226
227
  - lib/bookends/templates/footer.html