penchant 0.2.16 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -92,6 +92,12 @@ It then runs `bundle install`.
92
92
  You can also run `penchant gemfile ENV`. Just straight `penchant gemfile` will rebuild the `Gemfile` from
93
93
  `Gemfile.penchant` for whatever environment the `Gemfile` is currently using.
94
94
 
95
+ If you have an existing project, `penchant convert` will convert the `Gemfile` into a `Gemfile.penchant`
96
+ and add some bonuses, like defining that anything in `env :local` blocks automatically reference `..`,
97
+ ensuring that hooks are always installed when `penchant gemfile` is executed, and adding the `:github` gem property
98
+ that lets you pass in the username of the repo to reference that repo:
99
+ `gem 'penchant', :github => 'johnbintz'`.
100
+
95
101
  ### Deployment mode
96
102
 
97
103
  Use `no_deployment` blocks to indicate gems that shouldn't even appear in `Gemfiles` destined for
data/bin/penchant CHANGED
@@ -36,6 +36,17 @@ class PenchantCLI < Thor
36
36
  def convert
37
37
  install
38
38
  FileUtils.mv 'Gemfile', 'Gemfile.penchant'
39
+ prepend_to_file 'Gemfile.penchant', <<-RB
40
+ # ensure git hooks are always installed
41
+ ensure_git_hooks!
42
+
43
+ # everything in the :local env is assumed to be a sibling directory of this one
44
+ defaults_for env(:local), :path => '../%s'
45
+
46
+ # reference a github repository with gem 'my-gem', :github => 'username'
47
+ property :github, :git => 'git://github.com/$1/%s.git'
48
+
49
+ RB
39
50
  gemfile(:remote)
40
51
  end
41
52
 
data/features/cli.feature CHANGED
@@ -22,7 +22,7 @@ Feature: CLI
22
22
  source :rubygems
23
23
  """
24
24
  When I run "bin/penchant convert" in the "tmp" directory
25
- Then the file "tmp/Gemfile.penchant" should have the following content:
25
+ Then the file "tmp/Gemfile.penchant" should include the following content:
26
26
  """
27
27
  source :rubygems
28
28
  """
@@ -0,0 +1,3 @@
1
+ Then /^the file "(.*?)" should include the following content:$/ do |file, string|
2
+ File.read(file).should include(string)
3
+ end
@@ -21,12 +21,18 @@ module Penchant
21
21
  end
22
22
 
23
23
  def self.install!
24
- puts "[penchant] installing git hooks"
24
+ if git?
25
+ puts "[penchant] installing git hooks"
25
26
 
26
- Dir['script/hooks/*'].each do |hook|
27
- FileUtils.ln_sf File.join(Dir.pwd, hook), ".git/hooks/#{File.split(hook).last}"
27
+ Dir['script/hooks/*'].each do |hook|
28
+ FileUtils.ln_sf File.join(Dir.pwd, hook), "#{GIT_HOOKS_DIR}/#{File.split(hook).last}"
29
+ end
28
30
  end
29
31
  end
32
+
33
+ def self.git?
34
+ File.directory?(GIT_HOOKS_DIR)
35
+ end
30
36
  end
31
37
  end
32
38
 
@@ -1,3 +1,3 @@
1
1
  module Penchant
2
- VERSION = "0.2.16"
2
+ VERSION = "0.2.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: penchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-07 00:00:00.000000000 Z
12
+ date: 2012-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -151,6 +151,7 @@ files:
151
151
  - features/step_definitions/then/i_should_get_the_following_repositories.rb
152
152
  - features/step_definitions/then/the_file_gemfile_should_have_the_following_stripped_content.rb
153
153
  - features/step_definitions/then/the_file_should_have_content.rb
154
+ - features/step_definitions/then/the_file_tmp_gemfile_penchant_should_include_the_following_content.rb
154
155
  - features/step_definitions/then/the_output_should_include.rb
155
156
  - features/step_definitions/then/the_output_should_not_include_git_hooks_not_installed.rb
156
157
  - features/step_definitions/when/i_rebuild_the_gemfile_for_local_mode.rb
@@ -198,7 +199,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
199
  version: '0'
199
200
  segments:
200
201
  - 0
201
- hash: -4574522728835378129
202
+ hash: -2365201167288047
202
203
  required_rubygems_version: !ruby/object:Gem::Requirement
203
204
  none: false
204
205
  requirements:
@@ -207,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
208
  version: '0'
208
209
  segments:
209
210
  - 0
210
- hash: -4574522728835378129
211
+ hash: -2365201167288047
211
212
  requirements: []
212
213
  rubyforge_project: penchant
213
214
  rubygems_version: 1.8.23
@@ -228,6 +229,7 @@ test_files:
228
229
  - features/step_definitions/then/i_should_get_the_following_repositories.rb
229
230
  - features/step_definitions/then/the_file_gemfile_should_have_the_following_stripped_content.rb
230
231
  - features/step_definitions/then/the_file_should_have_content.rb
232
+ - features/step_definitions/then/the_file_tmp_gemfile_penchant_should_include_the_following_content.rb
231
233
  - features/step_definitions/then/the_output_should_include.rb
232
234
  - features/step_definitions/then/the_output_should_not_include_git_hooks_not_installed.rb
233
235
  - features/step_definitions/when/i_rebuild_the_gemfile_for_local_mode.rb