penchant 0.2.18 → 0.2.19

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/bin/penchant CHANGED
@@ -23,6 +23,16 @@ class PenchantCLI < Thor
23
23
  else
24
24
  puts "No git repository detected here. Skipping git hook installation..."
25
25
  end
26
+
27
+ if !File.file?('Gemfile') && !File.file?('Gemfile.penchant')
28
+ FileUtils.touch('Gemfile.penchant')
29
+
30
+ prepend_to_file 'Gemfile.penchant', <<-RB
31
+ source :rubygems
32
+ RB
33
+
34
+ install_gemfile_penchant
35
+ end
26
36
  end
27
37
 
28
38
  desc "update", "Update the installed scripts"
@@ -36,18 +46,7 @@ class PenchantCLI < Thor
36
46
  def convert
37
47
  install
38
48
  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
50
- gemfile(:remote)
49
+ install_gemfile_penchant
51
50
  end
52
51
 
53
52
  method_options :deployment => false
@@ -118,6 +117,20 @@ property :github, :git => 'git://github.com/$1/%s.git'
118
117
  puts
119
118
  end
120
119
  end
120
+
121
+ def install_gemfile_penchant
122
+ prepend_to_file 'Gemfile.penchant', <<-RB
123
+ # ensure git hooks are always installed
124
+ ensure_git_hooks!
125
+
126
+ # everything in the :local env is assumed to be a sibling directory of this one
127
+ defaults_for env(:local), :path => '../%s'
128
+
129
+ # reference a github repository with gem 'my-gem', :github => 'username'
130
+ property :github, :git => 'git://github.com/$1/%s.git'
131
+ RB
132
+ gemfile(:remote)
133
+ end
121
134
  end
122
135
 
123
136
  default_task :gemfile
data/features/cli.feature CHANGED
@@ -61,3 +61,18 @@ Feature: CLI
61
61
  Given I have the symlink "tmp/.git/hooks/pre-commit" which points to "tmp/script/hooks/pre-commit"
62
62
  When I run "bin/penchant gemfile remote" in the "tmp" directory
63
63
  Then the output should not include "git hooks not installed"
64
+
65
+ @wip
66
+ Scenario: Install Penchant into a directory with no Gemfile
67
+ Given I have the directory "tmp"
68
+ When I run "bin/penchant install" in the "tmp" directory
69
+ Then the file "tmp/Gemfile.penchant" should include the following content:
70
+ """
71
+ source :rubygems
72
+ """
73
+ Then the file "tmp/Gemfile" should include the following content:
74
+ """
75
+ source :rubygems
76
+ """
77
+ And the output should include "No git"
78
+
@@ -1,3 +1,3 @@
1
1
  module Penchant
2
- VERSION = "0.2.18"
2
+ VERSION = "0.2.19"
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.18
4
+ version: 0.2.19
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-15 00:00:00.000000000 Z
12
+ date: 2012-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -197,18 +197,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
197
  - - ! '>='
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
- segments:
201
- - 0
202
- hash: 1954295842592246039
203
200
  required_rubygems_version: !ruby/object:Gem::Requirement
204
201
  none: false
205
202
  requirements:
206
203
  - - ! '>='
207
204
  - !ruby/object:Gem::Version
208
205
  version: '0'
209
- segments:
210
- - 0
211
- hash: 1954295842592246039
212
206
  requirements: []
213
207
  rubyforge_project: penchant
214
208
  rubygems_version: 1.8.23