stairs 0.7.0 → 0.7.1

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: d00a852f658b8f3191f7ae6c5f7edf56823ecc38
4
- data.tar.gz: 424bc1126fe1cb6757b735a3b72a95032e225518
3
+ metadata.gz: 92ee164d25a4cba9bc7bc59b2e3c093fd02e5877
4
+ data.tar.gz: 79b76735f86f72b6aff583c7708b169bb91a4edb
5
5
  SHA512:
6
- metadata.gz: 4b7faabcf3e3168c77a3e3afb2d9da5d1cdb020ab71dd4f8a3a90870e4605b39ef37f496e5243e05fb26f4b7cb53a0d6af87d6ea939474892efeb64faefbf59e
7
- data.tar.gz: 53e273c0bf8ed61bc395cae6b366e9d9e32f12f54741f021dbf3dff5d6a645ae93e7d092156a079746d46abee344fea28b87622247281b330f5cd8359283b427
6
+ metadata.gz: 7cd51dbb32386d4a8f2b0b7d056d602b24cc8273b40b9350577af9acc8b125747400879c4624f6b88ebfb40aa9a749601d9e4fd1959177eab1f3d534f85c792d
7
+ data.tar.gz: 419d9a871c140ce33214cae856d330f7d96ecf81690d2feea64e9bb9e463fcf6317b55e8494b1a48038091fb9ef429e3c1a1cfaed8724984a6bd876abdc2233c
data/.rubocop.yml CHANGED
@@ -8,14 +8,22 @@ LineLength:
8
8
  CaseIndentation:
9
9
  Enabled: false
10
10
 
11
- # Seems unnecessary?
12
- ReduceArguments:
13
- Enabled: false
14
-
15
11
  # Not a part of our coding conventions
16
12
  Documentation:
17
13
  Enabled: false
18
14
 
15
+ DoubleNegation:
16
+ Enabled: false
17
+
18
+ TrailingComma:
19
+ EnforcedStyleForMultiline: comma
20
+
21
+ DeprecatedClassMethods:
22
+ Enabled: false
23
+
24
+ SingleLineBlockParams:
25
+ Enabled: false
26
+
19
27
  # Also just not something I've ever done or want to do...
20
28
  SpaceAroundEqualsInParameterDefault:
21
29
  Enabled: false
@@ -34,5 +42,5 @@ Encoding:
34
42
 
35
43
  # I just don't care so much about clean specs.. Like short methods and short lines
36
44
  AllCops:
37
- Excludes:
45
+ Exclude:
38
46
  - spec/**
data/README.md CHANGED
@@ -92,7 +92,7 @@ setup :misc do
92
92
  env "CHECK_IT", provide("Cool check it value")
93
93
  end
94
94
 
95
- rake "db:setup"
95
+ rake "db:setup db:test:prepare"
96
96
 
97
97
  finish "Just run rails s and sidekiq to get rolling!"
98
98
  ```
data/bin/stairs CHANGED
@@ -16,7 +16,7 @@ Stairs.configure do |config|
16
16
  options.on(
17
17
  "-g",
18
18
  "--groups GROUPS",
19
- "Specify groups to run. e.g. init,reset"
19
+ "Specify groups to run. e.g. init,reset",
20
20
  ) do |value|
21
21
  groups = value.split(",").map { |g| g.to_sym } if value
22
22
  end
@@ -14,18 +14,24 @@ module Stairs
14
14
  private
15
15
 
16
16
  def configure_env_adapter
17
+ require_installed_adapter!
18
+
17
19
  choice prompt do |yes|
18
20
  if yes
19
21
  use_recommended_adapter!
20
22
  else
21
- choice "Which would you prefer?", adapter_names do |name|
22
- adapter_class = Stairs::EnvAdapters::ADAPTERS[name.to_sym]
23
- Stairs.configuration.env_adapter = adapter_class.new
24
- end
23
+ select_env_adapter
25
24
  end
26
25
  end
27
26
  end
28
27
 
28
+ def select_env_adapter
29
+ choice "Which would you prefer?", adapter_names do |name|
30
+ adapter_class = Stairs::EnvAdapters::ADAPTERS[name.to_sym]
31
+ Stairs.configuration.env_adapter = adapter_class.new
32
+ end
33
+ end
34
+
29
35
  def use_recommended_adapter!
30
36
  Stairs.configuration.env_adapter = recommended_adapter.new
31
37
  end
@@ -46,7 +52,16 @@ module Stairs
46
52
  end
47
53
 
48
54
  def adapter_names
49
- Stairs::EnvAdapters::ADAPTERS.map { |n, _a| n.to_s }
55
+ @adapter_names ||= Stairs::EnvAdapters::ADAPTERS.map { |n, _a| n.to_s }
56
+ end
57
+
58
+ def require_installed_adapter!
59
+ unless recommended_adapter
60
+ abort <<-MSG
61
+ Please install a supported ENV variable manager:
62
+ #{adapter_names.join(", ")}
63
+ MSG
64
+ end
50
65
  end
51
66
  end
52
67
  end
data/lib/stairs/step.rb CHANGED
@@ -120,7 +120,7 @@ module Stairs
120
120
 
121
121
  class Choice
122
122
  # TODO: shouldn't care about case?
123
- def initialize(question, choices=%w[Y N], &block)
123
+ def initialize(question, choices=%w(Y N), &block)
124
124
  @question = question
125
125
  @choices = choices
126
126
  @block = block
@@ -1,3 +1,3 @@
1
1
  module Stairs
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -41,5 +41,13 @@ describe Stairs::InteractiveConfiguration do
41
41
  expect(Stairs.configuration.env_adapter).to be_a Stairs::EnvAdapters::Rbenv
42
42
  end
43
43
  end
44
+
45
+ context "when no adapter can be found to recommend" do
46
+ before { Stairs::EnvAdapters.stub recommended_adapter: nil }
47
+
48
+ it "aborts" do
49
+ expect { subject.run! }.to raise_error SystemExit
50
+ end
51
+ end
44
52
  end
45
53
  end
data/stairs.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "rb-fsevent", "~> 0.9.3"
27
27
  spec.add_development_dependency "awesome_print", "~> 1.2.0"
28
28
  spec.add_development_dependency "fakefs", "~> 0.4.3"
29
- spec.add_development_dependency "rubocop", "~> 0.14.1"
29
+ spec.add_development_dependency "rubocop", "~> 0.20.1"
30
30
  spec.add_development_dependency "guard-rubocop", "~> 1.0.0"
31
31
  spec.add_development_dependency "codeclimate-test-reporter"
32
32
  spec.add_development_dependency "mock_stdio", "~> 0.0.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stairs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - patbenatar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-21 00:00:00.000000000 Z
11
+ date: 2014-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: 0.14.1
131
+ version: 0.20.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ~>
137
137
  - !ruby/object:Gem::Version
138
- version: 0.14.1
138
+ version: 0.20.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: guard-rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -302,3 +302,4 @@ test_files:
302
302
  - spec/lib/stairs/util/file_mutation_spec.rb
303
303
  - spec/spec_helper.rb
304
304
  - spec/support/configuration_helper.rb
305
+ has_rdoc: