penchant 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Rakefile +11 -0
- data/lib/penchant/version.rb +1 -1
- data/script/gemfile +11 -0
- data/script/hooks/pre-commit +15 -0
- data/script/initialize-environment +35 -0
- data/script/install-git-hooks +6 -0
- data/template/script/hooks/pre-commit +1 -1
- metadata +5 -1
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/penchant/version.rb
CHANGED
data/script/gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
OLD_GIT_DIR=$GIT_DIR
|
4
|
+
|
5
|
+
if [ "$(penchant gemfile-env)" != "remote" ]; then
|
6
|
+
unset GIT_DIR
|
7
|
+
penchant gemfile remote
|
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
|
15
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if File.file?('Gemfile.erb')
|
4
|
+
pwd = Dir.pwd
|
5
|
+
|
6
|
+
Dir.chdir '..' do
|
7
|
+
File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line|
|
8
|
+
repo = line[%r{:git => (['"])(.*)\1}, 2]
|
9
|
+
|
10
|
+
puts "Installing #{repo}"
|
11
|
+
system %{git clone #{repo}}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
puts "Bundling for local environment"
|
16
|
+
system %{script/gemfile local}
|
17
|
+
else
|
18
|
+
puts "Bundling..."
|
19
|
+
system %{bundle}
|
20
|
+
end
|
21
|
+
|
22
|
+
puts "Installing git hooks"
|
23
|
+
system %{script/install-git-hooks}
|
24
|
+
|
25
|
+
bundle = File.file?('Gemfile') ? 'bundle exec' : ''
|
26
|
+
|
27
|
+
command = [ bundle, 'rake', '-s', '-T', 'bootstrap' ]
|
28
|
+
|
29
|
+
if !(%x{#{command.join(' ')}}).empty?
|
30
|
+
puts "Trying to run rake bootstrap..."
|
31
|
+
system %{#{bundle} rake bootstrap}
|
32
|
+
end
|
33
|
+
|
34
|
+
puts "Done!"
|
35
|
+
|
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.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -30,6 +30,10 @@ files:
|
|
30
30
|
- lib/penchant/gemfile.rb
|
31
31
|
- lib/penchant/version.rb
|
32
32
|
- penchant.gemspec
|
33
|
+
- script/gemfile
|
34
|
+
- script/hooks/pre-commit
|
35
|
+
- script/initialize-environment
|
36
|
+
- script/install-git-hooks
|
33
37
|
- spec/lib/penchant/gemfile_spec.rb
|
34
38
|
- spec/lib/penchant_spec.rb
|
35
39
|
- spec/spec_helper.rb
|