pompompom 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -1
- data/Rakefile +7 -0
- data/lib/pompompom/config.rb +4 -3
- data/lib/pompompom.rb +1 -1
- data/pompompom.gemspec +2 -2
- data/spec/pompompom/cli_spec.rb +2 -0
- data/spec/pompompom/config_spec.rb +10 -0
- data/spec/spec_helper.rb +7 -1
- data/tasks/spec.rake +1 -1
- metadata +12 -12
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/pompompom/config.rb
CHANGED
@@ -11,6 +11,7 @@ module PomPomPom
|
|
11
11
|
attr_reader :repositories, :target_dir, :cache_dir, :config_file
|
12
12
|
|
13
13
|
def initialize(options={})
|
14
|
+
@options_set = options.keys
|
14
15
|
@repositories = options[:repositories] || REPOSITORIES
|
15
16
|
@target_dir = options[:target_dir] || TARGET_DIR
|
16
17
|
@cache_dir = options[:cache_dir] || CACHE_DIR
|
@@ -20,9 +21,9 @@ module PomPomPom
|
|
20
21
|
def load!
|
21
22
|
return unless file_exists?
|
22
23
|
options = symbolize_keys(YAML.load(File.read(@config_file)))
|
23
|
-
@repositories = options[:repositories] || @repositories
|
24
|
-
@target_dir = options[:target_dir] || @target_dir
|
25
|
-
@cache_dir = options[:cache_dir] || @cache_dir
|
24
|
+
@repositories = options[:repositories] || @repositories unless @options_set.include?(:repositories)
|
25
|
+
@target_dir = options[:target_dir] || @target_dir unless @options_set.include?(:target_dir)
|
26
|
+
@cache_dir = options[:cache_dir] || @cache_dir unless @options_set.include?(:cache_dir)
|
26
27
|
end
|
27
28
|
|
28
29
|
def file_exists?
|
data/lib/pompompom.rb
CHANGED
data/pompompom.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{pompompom}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Theo Hultberg"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-08-06}
|
13
13
|
s.default_executable = %q{pompompom}
|
14
14
|
s.description = %q{Ruby dependency manager for Maven repository artifacts}
|
15
15
|
s.email = %q{theo@iconara.net}
|
data/spec/pompompom/cli_spec.rb
CHANGED
@@ -7,6 +7,7 @@ require 'yaml'
|
|
7
7
|
module PomPomPom
|
8
8
|
describe Cli do
|
9
9
|
before do
|
10
|
+
@cwd = Dir.getwd
|
10
11
|
@repository_path = File.expand_path('../../resources/repository', __FILE__)
|
11
12
|
@stdin = StringIO.new
|
12
13
|
@stdout = StringIO.new
|
@@ -22,6 +23,7 @@ module PomPomPom
|
|
22
23
|
end
|
23
24
|
|
24
25
|
after do
|
26
|
+
Dir.chdir(@cwd)
|
25
27
|
FileUtils.rm_rf(@tmp_dir)
|
26
28
|
end
|
27
29
|
|
@@ -34,6 +34,16 @@ module PomPomPom
|
|
34
34
|
config.target_dir.should == 'deps'
|
35
35
|
config.cache_dir.should == 'cache'
|
36
36
|
end
|
37
|
+
|
38
|
+
it 'does not clobber options that were set in the constructor' do
|
39
|
+
config_file = File.join(@tmp_dir, '.pom3rc')
|
40
|
+
File.open(config_file, 'w') { |f| f.write(YAML::dump(:cache_dir => 'cache', :target_dir => 'deps', :repositories => %w(repo1 repo2))) }
|
41
|
+
config = Config.new(:config_file => config_file, :repositories => %w(repo3 repo4))
|
42
|
+
config.load!
|
43
|
+
config.repositories.should == %w(repo3 repo4)
|
44
|
+
config.target_dir.should == 'deps'
|
45
|
+
config.cache_dir.should == 'cache'
|
46
|
+
end
|
37
47
|
end
|
38
48
|
|
39
49
|
describe '#file_exists?' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
$: << File.expand_path('../../lib', __FILE__)
|
2
2
|
|
3
|
+
unless defined?(Bundler)
|
4
|
+
require 'rubygems'
|
5
|
+
require 'bundler'
|
6
|
+
end
|
7
|
+
|
8
|
+
Bundler.setup(:default, :test)
|
9
|
+
|
3
10
|
require 'pompompom'
|
4
11
|
require 'pompompom/cli'
|
5
12
|
require 'pompompom/rake'
|
6
|
-
require 'rubygems'
|
data/tasks/spec.rake
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pompompom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Theo Hultberg
|
@@ -15,13 +15,14 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-08-06 00:00:00 +02:00
|
19
19
|
default_executable: pompompom
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
22
|
+
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
name: immutable_struct
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
26
|
none: false
|
26
27
|
requirements:
|
27
28
|
- - ">="
|
@@ -30,12 +31,12 @@ dependencies:
|
|
30
31
|
segments:
|
31
32
|
- 0
|
32
33
|
version: "0"
|
33
|
-
|
34
|
-
version_requirements: *id001
|
34
|
+
requirement: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
36
|
+
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
|
38
|
+
name: hpricot
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
41
|
requirements:
|
41
42
|
- - ">="
|
@@ -44,8 +45,7 @@ dependencies:
|
|
44
45
|
segments:
|
45
46
|
- 0
|
46
47
|
version: "0"
|
47
|
-
|
48
|
-
version_requirements: *id002
|
48
|
+
requirement: *id002
|
49
49
|
description: Ruby dependency manager for Maven repository artifacts
|
50
50
|
email: theo@iconara.net
|
51
51
|
executables:
|