fontana_client_support 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTZhZWVhYzllN2JjM2FlYjcxMGRiMTVhM2RiNzhlODZkZmI5MGM3ZQ==
4
+ ODNkZThlYjhhNWMzZGM2OTZjNGU3YzA0ZmU4N2QzYWUzNjMyNmQ0Ng==
5
5
  data.tar.gz: !binary |-
6
- ZWRhNjY1MTkyZDM1YWI5MjE0Yjk0ZWMwNzQxZWRiYTBlZGM1ZjlmZQ==
6
+ MmMxZTY5NGM5MGRmZjlmZTBiZjYzMjJlNDE1MGExNzJmMTY5MTY0Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTBjMGNhZGQ0N2IwZDdkM2M2ZWY1ZDg4M2U1MzE2MDM5MDdjNDhiMTQ0ZGU1
10
- ZDA0ZjAyMDI4YTUzYWY2ZTI1NTgwN2JhNGFkN2Y2OGUxNWRlMDI0OTE2NGMy
11
- Y2FhNmEyODI2ZDIxMjk4NzA4YWJhYzVjODM0OTg3YTkzZTE2M2E=
9
+ ZDI5OTY3OTI5MTc1NTk4ODRkMDUxNWM0NjQ2OWY4ZDU5NjQzN2I2ZjM3MmQx
10
+ ZmRiNjc4ZWE1ZTk4MjdmMGJjN2ZhMmRlOTU5ZWFkODJhOTVhNjBkNjVjOWZh
11
+ ZWNkMjk2MGJlZmJhNzA1ZGEwYTU0NjNhOTY3NjM1Njc5NzJlZjE=
12
12
  data.tar.gz: !binary |-
13
- NGFiZDE2MGE2ZGQwNTdmZTVlYmVkZjQxZmY3OTgyYTRiMTBjMjdkODc4ZWEy
14
- Y2VlNjRiNDQ1OWM4MzUxODJhZjk5NjVjOWI2NDg3M2QzNjcyN2NhZDZmMDZl
15
- ZmUxYTc3NWE3MGJiZDQ5OTgxODYyMGE1MjVmZTIyMjEwMDI3ZGE=
13
+ MjQxNmFiYmUxYTRlMDVkOGI0MmFhNWUyNmZmZDliZGI0OTJhMDY5MjJmMDE1
14
+ ZmQ0YTMyYTdhZWY0NjcxYWE3MmE3Y2EwN2E5NGFiOWM1Zjk5ZDk1MzNjYjYy
15
+ NTU3MzI4ZWUxNzViMmFkZGNlMDljMTdiMTAxZTg3M2NlZTM1ZDk=
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH << File.expand_path("../../lib", __FILE__)
4
+
5
+ require 'optparse'
6
+
7
+ default_options = {
8
+ "host" => "localhost",
9
+ "port" => 3000,
10
+ }
11
+
12
+ banner = "%s <fixture_name> [options]" % File.basename(__FILE__)
13
+ parser = OptionParser.new(banner) do |opt|
14
+ opt.on '-h', '--host HOST'
15
+ opt.on '-p', '--port PORT'
16
+ opt.on '-a', "--address BINDING_ADDRESS"
17
+ opt.on '-d', '--document-root DOCUMENT_ROOT_PATH'
18
+ end
19
+
20
+ fixture_name = ARGV.shift
21
+
22
+ options = default_options.merge(parser.getopts(ARGV))
23
+ options = options.each_with_object({}){|(k,v), d| d[k.gsub(/-/, '_').to_sym] = v}
24
+
25
+ require 'fontana'
26
+ Fontana.load_fixture(fixture_name, options)
@@ -0,0 +1,16 @@
1
+ require "fontana"
2
+
3
+ require 'httpclient'
4
+
5
+ module Fontana
6
+
7
+ module Fixture
8
+ def load_fixture(fixture_name, options = {})
9
+ options = options.update({host: "localhost", port: 3000})
10
+ c = HTTPClient.new
11
+ res = c.post("http://#{options[:host]}:#{options[:port]}/libgss_test/fixture_loadings/#{fixture_name}.json", "_method" => "put")
12
+ raise "#{res.code} #{res.http_body.content}" unless res.code.to_s =~ /\A2\d\d\Z/
13
+ end
14
+ end
15
+
16
+ end
data/lib/fontana.rb CHANGED
@@ -4,6 +4,9 @@ module Fontana
4
4
  autoload :CommandUtils, 'fontana/command_utils'
5
5
  autoload :ServerRake , 'fontana/server_rake'
6
6
  autoload :RakeUtils , 'fontana/rake_utils'
7
+ autoload :Fixture , 'fontana/fixture'
8
+
9
+ extend Fontana::Fixture
7
10
 
8
11
  class << self
9
12
  # attr_accessor :home
@@ -1,3 +1,3 @@
1
1
  module FontanaClientSupport
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
@@ -53,6 +53,7 @@ module FontanaClientSupport
53
53
  self
54
54
  end
55
55
  end
56
+
56
57
  end
57
58
 
58
59
  require 'fontana'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontana_client_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - akima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-09 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -85,6 +85,7 @@ email:
85
85
  - t-akima@groovenauts.jp
86
86
  executables:
87
87
  - fontana_config_server
88
+ - fontana_fixture
88
89
  extensions: []
89
90
  extra_rdoc_files: []
90
91
  files:
@@ -95,9 +96,11 @@ files:
95
96
  - README.md
96
97
  - Rakefile
97
98
  - bin/fontana_config_server
99
+ - bin/fontana_fixture
98
100
  - fontana_client_support.gemspec
99
101
  - lib/fontana.rb
100
102
  - lib/fontana/command_utils.rb
103
+ - lib/fontana/fixture.rb
101
104
  - lib/fontana/rake_utils.rb
102
105
  - lib/fontana/server_rake.rb
103
106
  - lib/fontana_client_support.rb