rconf 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ # Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
2
+ #
3
+ # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
+ # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
+ # reproduction, modification, or disclosure of this program is
6
+ # strictly prohibited. Any use of this program by an authorized
7
+ # licensee is strictly subject to the terms and conditions,
8
+ # including confidentiality obligations, set forth in the applicable
9
+ # License Agreement between RightScale.com, Inc. and
10
+ # the licensee
11
+
12
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
13
+
14
+ describe RightConf::FileReporter do
15
+
16
+ it 'should write to given file' do
17
+ file = File.join(File.dirname(__FILE__), '__output')
18
+ begin
19
+ File.delete(file) if File.exist?(file)
20
+ reporter = RightConf::FileReporter.new(file)
21
+ reporter.write("42\n43\n44")
22
+ res = IO.read(file)
23
+ res.count("\n").should == 3
24
+ ensure
25
+ File.delete(file) rescue nil
26
+ end
27
+ end
28
+
29
+ end
30
+
31
+
@@ -0,0 +1,23 @@
1
+ # Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
2
+ #
3
+ # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
+ # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
+ # reproduction, modification, or disclosure of this program is
6
+ # strictly prohibited. Any use of this program by an authorized
7
+ # licensee is strictly subject to the terms and conditions,
8
+ # including confidentiality obligations, set forth in the applicable
9
+ # License Agreement between RightScale.com, Inc. and
10
+ # the licensee
11
+
12
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
13
+
14
+ describe RightConf::StdoutReporter do
15
+
16
+ it 'should write to STDOUT' do
17
+ reporter = RightConf::StdoutReporter.new
18
+ flexmock($stdout).should_receive(:print).with("42\n")
19
+ reporter.report('42')
20
+ end
21
+
22
+ end
23
+
@@ -0,0 +1,35 @@
1
+ # Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
2
+ #
3
+ # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
+ # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
+ # reproduction, modification, or disclosure of this program is
6
+ # strictly prohibited. Any use of this program by an authorized
7
+ # licensee is strictly subject to the terms and conditions,
8
+ # including confidentiality obligations, set forth in the applicable
9
+ # License Agreement between RightScale.com, Inc. and
10
+ # the licensee
11
+
12
+ require File.join(File.dirname(__FILE__), 'spec_helper')
13
+
14
+ describe RightConf::Singleton do
15
+
16
+ class Testy
17
+ include RightConf::Singleton
18
+ def testosterone
19
+ 42
20
+ end
21
+ def call_block(*args, &blk)
22
+ blk.call
23
+ end
24
+ end
25
+
26
+ it 'should forward class methods invokations to singleton instance' do
27
+ Testy.testosterone.should == 42
28
+ Testy.instance.testosterone.should == 42
29
+ end
30
+
31
+ it 'should also forward blocks' do
32
+ Testy.call_block { 43 }.should == 43
33
+ end
34
+
35
+ end
@@ -0,0 +1,21 @@
1
+ # Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
2
+ #
3
+ # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
+ # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
5
+ # reproduction, modification, or disclosure of this program is
6
+ # strictly prohibited. Any use of this program by an authorized
7
+ # licensee is strictly subject to the terms and conditions,
8
+ # including confidentiality obligations, set forth in the applicable
9
+ # License Agreement between RightScale.com, Inc. and
10
+ # the licensee
11
+
12
+ require 'rubygems'
13
+ require 'rspec'
14
+ require "flexmock"
15
+
16
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'rconf')
17
+
18
+ RSpec.configure do |c|
19
+ c.mock_with(:flexmock)
20
+ end
21
+
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rconf
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.5.0
6
+ platform: ruby
7
+ authors:
8
+ - Raphael Simon
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-03-02 00:00:00 -08:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rspec
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: "2.5"
25
+ type: :development
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: flexmock
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: "0.9"
36
+ type: :development
37
+ version_requirements: *id002
38
+ description: |
39
+ rconf configures the environment for a given application. rconf reads
40
+ the content of an application configuration file (.rc) and installs and/or
41
+ configures the required tools for running or developing the corresponding
42
+ application. rconf can easily be extended to configure new tools and makes
43
+ it easy to support multiple platforms.
44
+ Consult the README.rdoc file for information on how to write rconf
45
+ configuration files (.rc).
46
+
47
+ email:
48
+ - raphael@rightscale.com
49
+ executables:
50
+ - rconf
51
+ extensions: []
52
+
53
+ extra_rdoc_files: []
54
+
55
+ files:
56
+ - README.rdoc
57
+ - Rakefile
58
+ - bin/rconf
59
+ - examples/sample.rc
60
+ - lib/rconf.rb
61
+ - lib/rconf/command.rb
62
+ - lib/rconf/configurator.rb
63
+ - lib/rconf/configurator_registry.rb
64
+ - lib/rconf/configurators/bundler_configurator.rb
65
+ - lib/rconf/configurators/ruby_configurator.rb
66
+ - lib/rconf/language.rb
67
+ - lib/rconf/platform.rb
68
+ - lib/rconf/platforms/darwin.rb
69
+ - lib/rconf/platforms/linux.rb
70
+ - lib/rconf/platforms/windows.rb
71
+ - lib/rconf/progress_reporter.rb
72
+ - lib/rconf/progress_reporters/base_reporter.rb
73
+ - lib/rconf/progress_reporters/file_reporter.rb
74
+ - lib/rconf/progress_reporters/stdout_reporter.rb
75
+ - lib/rconf/ruby_extensions.rb
76
+ - lib/rconf/trollop.rb
77
+ - lib/rconf/version.rb
78
+ - rconf.gemspec
79
+ - spec/command_spec.rb
80
+ - spec/configurator_spec.rb
81
+ - spec/configurators/bundler_configurator_spec.rb
82
+ - spec/configurators/ruby_configurator_spec.rb
83
+ - spec/language_spec.rb
84
+ - spec/platform_spec.rb
85
+ - spec/progress_reporters/base_reporter_spec.rb
86
+ - spec/progress_reporters/file_reporter_spec.rb
87
+ - spec/progress_reporters/stdout_reporter_spec.rb
88
+ - spec/ruby_extensions_spec.rb
89
+ - spec/spec_helper.rb
90
+ has_rdoc: true
91
+ homepage: http://rubygems.org/gems/rconf
92
+ licenses: []
93
+
94
+ post_install_message:
95
+ rdoc_options: []
96
+
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: "0"
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: "0"
111
+ requirements: []
112
+
113
+ rubyforge_project: rconf
114
+ rubygems_version: 1.5.0
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: Cross platform environment configuration
118
+ test_files:
119
+ - spec/command_spec.rb
120
+ - spec/configurator_spec.rb
121
+ - spec/configurators/bundler_configurator_spec.rb
122
+ - spec/configurators/ruby_configurator_spec.rb
123
+ - spec/language_spec.rb
124
+ - spec/platform_spec.rb
125
+ - spec/progress_reporters/base_reporter_spec.rb
126
+ - spec/progress_reporters/file_reporter_spec.rb
127
+ - spec/progress_reporters/stdout_reporter_spec.rb
128
+ - spec/ruby_extensions_spec.rb
129
+ - spec/spec_helper.rb