cyoi 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,10 @@
2
2
 
3
3
  Cyoi (choose-your-own-infrastructure) is a library to ask an end-user to choose an infrastructure (AWS, OpenStack, etc), region, and login credentials.
4
4
 
5
+ ## v0.4
6
+
7
+ * switch to using readwritesettings instead of fork of settingslogic
8
+
5
9
  ## v0.3
6
10
 
7
11
  * added `cyoi keypair` & `cyoi key_pair`
data/Gemfile CHANGED
@@ -3,8 +3,6 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in cyoi.gemspec
4
4
  gemspec
5
5
 
6
- gem "settingslogic", github: "drnic/settingslogic", branch: "integration"
7
-
8
6
  group :development do
9
7
  gem "awesome_print"
10
8
  gem "rb-fsevent", "~> 0.9.1"
data/README.md CHANGED
@@ -53,19 +53,16 @@ settings["provider"]["credentials"] # aws or openstack URLs & credentials
53
53
 
54
54
  ## Installation
55
55
 
56
- Add this line to your application's Gemfile:
56
+ To use as a stand-alone CLI, install the rubygem:
57
57
 
58
58
  ```
59
- gem "cyoi"
60
- gem "settingslogic", github: "drnic/settingslogic", branch: "integration"
59
+ $ gem install cyoi
61
60
  ```
62
61
 
63
- NOTE: The `settingslogic` fork is necessary for some unmerged/unreleased extensions.
64
-
65
- And then execute:
62
+ To use it as a library within your own application, add this line to your application's Gemfile:
66
63
 
67
64
  ```
68
- $ bundle
65
+ gem "cyoi"
69
66
  ```
70
67
 
71
68
  ## Contributing
@@ -24,7 +24,7 @@ README
24
24
 
25
25
  spec.add_dependency "fog"
26
26
  spec.add_dependency "highline", "~> 1.6"
27
- spec.add_dependency "settingslogic", "~> 2.0.9" # need to_nested_hash method
27
+ spec.add_dependency "readwritesettings", "~> 3.0"
28
28
 
29
29
  spec.add_development_dependency "bundler", "~> 1.3"
30
30
  spec.add_development_dependency "rake"
@@ -8,8 +8,8 @@ class Cyoi::Cli::AutoDetection::UI
8
8
 
9
9
  def initialize(attributes, highline)
10
10
  @hl = highline
11
- @attributes = attributes.is_a?(Hash) ? Settingslogic.new(attributes) : attributes
12
- raise "@attributes must be Settingslogic (or Hash)" unless @attributes.is_a?(Settingslogic)
11
+ @attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes
12
+ raise "@attributes must be ReadWriteSettings (or Hash)" unless @attributes.is_a?(ReadWriteSettings)
13
13
  end
14
14
 
15
15
  def perform
@@ -1,4 +1,4 @@
1
- require "settingslogic"
1
+ require "readwritesettings"
2
2
  require "fileutils"
3
3
 
4
4
  module Cyoi::Cli::Helpers::Settings
@@ -29,12 +29,12 @@ module Cyoi::Cli::Helpers::Settings
29
29
  end
30
30
  chmod(0600, settings_path)
31
31
  chmod(0700, settings_ssh_dir) if File.directory?(settings_ssh_dir)
32
- Settingslogic.new(settings_path)
32
+ ReadWriteSettings.new(settings_path)
33
33
  end
34
34
  end
35
35
 
36
- # Saves current nested Settingslogic into pure Hash-based YAML file
37
- # Recreates accessors on Settingslogic object (since something has changed)
36
+ # Saves current nested ReadWriteSettings into pure Hash-based YAML file
37
+ # Recreates accessors on ReadWriteSettings object (since something has changed)
38
38
  def save_settings!
39
39
  File.open(settings_path, "w") { |f| f << settings.to_nested_hash.to_yaml }
40
40
  settings.create_accessors!
@@ -7,8 +7,8 @@ class Cyoi::Cli::Addresses::AddressCliAws
7
7
  def initialize(provider_client, attributes, highline)
8
8
  @provider_client = provider_client
9
9
  @hl = highline
10
- @attributes = attributes.is_a?(Hash) ? Settingslogic.new(attributes) : attributes
11
- raise "@attributes must be Settingslogic (or Hash)" unless @attributes.is_a?(Settingslogic)
10
+ @attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes
11
+ raise "@attributes must be ReadWriteSettings (or Hash)" unless @attributes.is_a?(ReadWriteSettings)
12
12
  end
13
13
 
14
14
  def perform_and_return_attributes
@@ -7,8 +7,8 @@ class Cyoi::Cli::KeyPair::KeyPairCliAws
7
7
  def initialize(provider_client, attributes, highline)
8
8
  @provider_client = provider_client
9
9
  @hl = highline
10
- @attributes = attributes.is_a?(Hash) ? Settingslogic.new(attributes) : attributes
11
- raise "@attributes must be Settingslogic (or Hash)" unless @attributes.is_a?(Settingslogic)
10
+ @attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes
11
+ raise "@attributes must be ReadWriteSettings (or Hash)" unless @attributes.is_a?(ReadWriteSettings)
12
12
  raise "@attributes.name must be set" unless @attributes["name"]
13
13
  end
14
14
 
@@ -6,8 +6,8 @@ class Cyoi::Cli::Providers::ProviderCli
6
6
 
7
7
  def initialize(attributes, highline)
8
8
  @hl = highline
9
- @attributes = attributes.is_a?(Hash) ? Settingslogic.new(attributes) : attributes
10
- raise "@attributes must be Settingslogic (or Hash)" unless @attributes.is_a?(Settingslogic)
9
+ @attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes
10
+ raise "@attributes must be ReadWriteSettings (or Hash)" unless @attributes.is_a?(ReadWriteSettings)
11
11
  end
12
12
 
13
13
  # helper to export the complete nested attributes.
@@ -9,7 +9,7 @@ module Cyoi::Providers
9
9
  # with helpers related to that provider
10
10
  # returns nil if +attributes.name+ is unknown
11
11
  def provider_client(attributes)
12
- attributes = attributes.is_a?(Hash) ? Settingslogic.new(attributes) : attributes
12
+ attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes
13
13
  case attributes.name.to_sym
14
14
  when :aws
15
15
  @aws_provider_client ||= begin
@@ -8,8 +8,8 @@ class Cyoi::Providers::Clients::FogProviderClient
8
8
  attr_reader :attributes
9
9
 
10
10
  def initialize(attributes)
11
- @attributes = attributes.is_a?(Hash) ? Settingslogic.new(attributes) : attributes
12
- raise "@attributes must be Settingslogic (or Hash)" unless @attributes.is_a?(Settingslogic)
11
+ @attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes
12
+ raise "@attributes must be ReadWriteSettings (or Hash)" unless @attributes.is_a?(ReadWriteSettings)
13
13
  setup_fog_connection
14
14
  end
15
15
 
@@ -1,3 +1,3 @@
1
1
  module Cyoi
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -5,7 +5,7 @@ describe "cyoi key_pair aws" do
5
5
  before { @settings_dir = File.expand_path("~/.cyoi_client_lib") }
6
6
 
7
7
  it "fails nicely if provider.name missing" do
8
- run_interactive(unescape("cyoi key_pair #{settings_dir}"))
8
+ run_interactive(unescape("cyoi key_pair testname #{settings_dir}"))
9
9
  assert_failing_with("Please run 'cyoi provider' first")
10
10
  end
11
11
 
@@ -19,10 +19,11 @@ describe "cyoi key_pair aws" do
19
19
  end
20
20
 
21
21
  it "create new key pair (didn't already exist in AWS)" do
22
+ run_interactive(unescape("cyoi key_pair testname #{settings_dir}"))
22
23
  assert_passing_with(<<-OUT)
23
- Provisioning new key pair microbosh-test-bosh... done
24
+ Acquiring a key pair testname... done
24
25
 
25
- Confirm: Using key pair microbosh-test-bosh
26
+ Confirming: Using key pair testname
26
27
  OUT
27
28
  end
28
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyoi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -44,13 +44,13 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.6'
46
46
  - !ruby/object:Gem::Dependency
47
- name: settingslogic
47
+ name: readwritesettings
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 2.0.9
53
+ version: '3.0'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.9
61
+ version: '3.0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: bundler
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -192,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  segments:
194
194
  - 0
195
- hash: 3080735547903421665
195
+ hash: -3776246876278909178
196
196
  required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  none: false
198
198
  requirements:
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  segments:
203
203
  - 0
204
- hash: 3080735547903421665
204
+ hash: -3776246876278909178
205
205
  requirements: []
206
206
  rubyforge_project:
207
207
  rubygems_version: 1.8.25