sdbport 0.0.1

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.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use ruby-1.9.3-p125@sdbport --create
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in sdbport.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Brett Weaver
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Sdbport
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'sdbport'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install sdbport
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/sdbport ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'sdbport'
4
+ require 'sdbport/cli'
5
+
6
+ Sdbport::CLI.start
@@ -0,0 +1,33 @@
1
+ require 'fog'
2
+
3
+ module Sdbport
4
+ module AWS
5
+ class SimpleDB
6
+
7
+ def initialize(args)
8
+ access_key = args[:access_key]
9
+ secret_key = args[:secret_key]
10
+ region = args[:region]
11
+ options = { :aws_access_key_id => access_key,
12
+ :aws_secret_access_key => secret_key,
13
+ :region => region }
14
+
15
+ @sdb = Fog::AWS::SimpleDB.new options
16
+ end
17
+
18
+ def export
19
+ select "select * from heirloom"
20
+ end
21
+
22
+ def select(query)
23
+ @sdb.select(query).body['Items']
24
+ end
25
+
26
+ def count(domain)
27
+ body = @sdb.select("SELECT count(*) FROM `#{domain}`").body
28
+ body['Items']['Domain']['Count'].first.to_i
29
+ end
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1 @@
1
+ require "sdbport/aws/simpledb"
@@ -0,0 +1,16 @@
1
+ require 'trollop'
2
+
3
+ module Sdbport
4
+ module CLI
5
+ def self.start
6
+ cmd = ARGV.shift
7
+
8
+ case cmd
9
+ when 'export'
10
+ puts 'export'
11
+ when 'import'
12
+ puts 'import'
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ module Sdbport
2
+ VERSION = "0.0.1"
3
+ end
data/lib/sdbport.rb ADDED
@@ -0,0 +1,2 @@
1
+ require "sdbport/aws"
2
+ require "sdbport/version"
data/sdbport.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sdbport/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "sdbport"
8
+ gem.version = Sdbport::VERSION
9
+ gem.authors = ["Brett Weaver"]
10
+ gem.email = ["brett@weav.net"]
11
+ gem.description = %q{I import and export simpledb domains}
12
+ gem.summary = %q{I import and export simpledb domains}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_development_dependency "rspec"
21
+
22
+ gem.add_runtime_dependency "fog"
23
+ gem.add_runtime_dependency "trollop"
24
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sdbport
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brett Weaver
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-09-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70235169749400 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70235169749400
25
+ - !ruby/object:Gem::Dependency
26
+ name: fog
27
+ requirement: &70235169748860 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70235169748860
36
+ - !ruby/object:Gem::Dependency
37
+ name: trollop
38
+ requirement: &70235169748340 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70235169748340
47
+ description: I import and export simpledb domains
48
+ email:
49
+ - brett@weav.net
50
+ executables:
51
+ - sdbport
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - .gitignore
56
+ - .rvmrc
57
+ - Gemfile
58
+ - LICENSE.txt
59
+ - README.md
60
+ - Rakefile
61
+ - bin/sdbport
62
+ - lib/sdbport.rb
63
+ - lib/sdbport/aws.rb
64
+ - lib/sdbport/aws/simpledb.rb
65
+ - lib/sdbport/cli.rb
66
+ - lib/sdbport/version.rb
67
+ - sdbport.gemspec
68
+ homepage: ''
69
+ licenses: []
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ segments:
81
+ - 0
82
+ hash: 380539940860521686
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ segments:
90
+ - 0
91
+ hash: 380539940860521686
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 1.8.16
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: I import and export simpledb domains
98
+ test_files: []