penchant 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -16,7 +16,7 @@ Installs a bunch of scripts into the `scripts` directory of your project:
16
16
 
17
17
  * `gemfile` which switches between `Gemfile.erb` environments
18
18
  * `install-git-hooks` which will do just what it says
19
- * `hooks/pre-commit`, one of the hooks the prior script installs
19
+ * `hooks`, several git hooks that the prior script symlinks into .git/hooks for you
20
20
  * `initialize-environment`, which bootstraps your local environment so you can get up and running
21
21
 
22
22
  ## Gemfile.erb?!
@@ -100,6 +100,12 @@ It runs `penchant gemfile remote` then runs `bundle exec rake`. Make sure your d
100
100
  tests and performs any other magic necessary before each commit. Your re-environmented Gemfile and Gemfile.lock will be added
101
101
  to your commit if they've changed.
102
102
 
103
+ ### Skipping all that Rake falderal?
104
+
105
+ Do it Travis CI style: stick `[ci skip]` in your commit message. That's why the meat of hte git hooks resides in
106
+ `commit-msg` and not `pre-commit`: you need the commit message before you can determine if the tests should be run
107
+ based on the commit message. Weird, I know.
108
+
103
109
  ## How?!
104
110
 
105
111
  * `gem install penchant`
@@ -108,5 +114,6 @@ to your commit if they've changed.
108
114
  And then one of the following:
109
115
 
110
116
  * `penchant install` for a new project (`--dir=WHEREVER` will install the scripts to a directory other than `$PWD/scripts`)
117
+ * `penchant update` to update the installation (`--dir=WHEVEVER` works here, too)
111
118
  * `penchant convert` for an existing project (`--dir=WHEVEVER` works here, too)
112
119
 
data/bin/penchant CHANGED
@@ -20,6 +20,12 @@ class PenchantCLI < Thor
20
20
  end
21
21
  end
22
22
 
23
+ desc "update", "Update the installed scripts"
24
+ method_options :dir => 'script'
25
+ def update
26
+ install
27
+ end
28
+
23
29
  desc "convert", "Make an existing project Penchant-isized"
24
30
  method_options :dir => 'script'
25
31
  def convert
@@ -1,3 +1,3 @@
1
1
  module Penchant
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ msg=$(cat $1)
4
+
5
+ OLD_GIT_DIR=$GIT_DIR
6
+
7
+ if [[ "${msg}" != *"[ci skip]"* ]]; then
8
+ if [ "$(penchant gemfile-env)" != "remote" ]; then
9
+ penchant gemfile remote
10
+ fi
11
+
12
+ bundle exec rake
13
+ R=$?
14
+ if [ $R -ne 0 ]; then exit $R; fi
15
+ fi
16
+
17
+ if [ "$(penchant gemfile-env)" != "remote deployment" ]; then
18
+ unset GIT_DIR
19
+ penchant gemfile remote --deployment
20
+ GIT_DIR=$OLD_GIT_DIR
21
+ git add Gemfile*
22
+ fi
23
+
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ penchant gemfile remote --switch-back
4
+
@@ -1,15 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
- OLD_GIT_DIR=$GIT_DIR
4
-
5
- if [ "$(penchant gemfile-env)" != "remote" ]; then
6
- unset GIT_DIR
7
- penchant gemfile remote --deployment
8
- GIT_DIR=$OLD_GIT_DIR
9
- git add Gemfile*
10
- fi
11
-
12
- bundle exec rake
13
- R=$?
14
- if [ $R -ne 0 ]; then exit $R; fi
3
+ # this is now handled in commit-msg, to allow for skipping of test running based on the commit message
15
4
 
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.1.0
4
+ version: 0.1.1
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-04-18 00:00:00.000000000 Z
12
+ date: 2012-04-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Things I do for my Rails projects to get up to speed in new environments
15
15
  fast
@@ -41,6 +41,8 @@ files:
41
41
  - lib/penchant/version.rb
42
42
  - penchant.gemspec
43
43
  - script/gemfile
44
+ - script/hooks/commit-msg
45
+ - script/hooks/post-commit
44
46
  - script/hooks/pre-commit
45
47
  - script/initialize-environment
46
48
  - script/install-git-hooks
@@ -67,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
67
69
  version: '0'
68
70
  segments:
69
71
  - 0
70
- hash: 3149014216967544178
72
+ hash: -2805133852426367993
71
73
  required_rubygems_version: !ruby/object:Gem::Requirement
72
74
  none: false
73
75
  requirements:
@@ -76,10 +78,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
78
  version: '0'
77
79
  segments:
78
80
  - 0
79
- hash: 3149014216967544178
81
+ hash: -2805133852426367993
80
82
  requirements: []
81
83
  rubyforge_project: penchant
82
- rubygems_version: 1.8.11
84
+ rubygems_version: 1.8.17
83
85
  signing_key:
84
86
  specification_version: 3
85
87
  summary: Things I do for my Rails projects to get up to speed in new environments