yun 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/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.8.7@yun_dev
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'fog', '>= 1.0.0'
4
+ gem 'hirb'
5
+ gem 'thor'
data/Gemfile.lock ADDED
@@ -0,0 +1,33 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ builder (3.0.0)
5
+ excon (0.7.6)
6
+ fog (1.0.0)
7
+ builder
8
+ excon (~> 0.7.3)
9
+ formatador (~> 0.2.0)
10
+ mime-types
11
+ multi_json (~> 1.0.3)
12
+ net-scp (~> 1.0.4)
13
+ net-ssh (~> 2.1.4)
14
+ nokogiri (~> 1.5.0)
15
+ ruby-hmac
16
+ formatador (0.2.1)
17
+ hirb (0.5.0)
18
+ mime-types (1.17.2)
19
+ multi_json (1.0.3)
20
+ net-scp (1.0.4)
21
+ net-ssh (>= 1.99.1)
22
+ net-ssh (2.1.4)
23
+ nokogiri (1.5.0)
24
+ ruby-hmac (0.4.0)
25
+ thor (0.14.6)
26
+
27
+ PLATFORMS
28
+ ruby
29
+
30
+ DEPENDENCIES
31
+ fog (>= 1.0.0)
32
+ hirb
33
+ thor
data/bin/yun ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'yun'
data/lib/yun/cli.rb ADDED
@@ -0,0 +1,12 @@
1
+ require 'thor'
2
+ require 'thor/group'
3
+ require 'yun/commands/node_command'
4
+
5
+ module Yun
6
+ class CLI < Thor
7
+
8
+ register Node, :node, "node", "commands for node"
9
+ end
10
+ end
11
+
12
+ Yun::CLI.start
@@ -0,0 +1,12 @@
1
+ require 'thor'
2
+
3
+ module Yun
4
+ class Node < Thor
5
+
6
+ desc "list", "list all nodes"
7
+ def list
8
+ Yun.list
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ module Yun
2
+ VERSION = "0.0.1"
3
+ end
data/lib/yun/yun.rb ADDED
@@ -0,0 +1,26 @@
1
+ require 'fog'
2
+ require 'hirb'
3
+
4
+ module Yun
5
+ class Yun
6
+
7
+ def self.list
8
+ nodes = Fog::Compute.new({:provider => "aws",
9
+ :region => "us-west-1"}).servers.map do |node|
10
+ {
11
+ :id => node.id,
12
+ :flavor_id => node.flavor_id,
13
+ :image_id => node.image_id,
14
+ :address => node.private_ip_address,
15
+ :created_at => node.created_at,
16
+ :status => node.state,
17
+ :instance_type => node.root_device_type
18
+ }
19
+ end.sort_by do |node|
20
+ node[:id] || ""
21
+ end
22
+
23
+ puts Hirb::Helpers::AutoTable.render nodes
24
+ end
25
+ end
26
+ end
data/lib/yun.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'yun/yun'
2
+ require 'yun/cli'
data/yun.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ $: << File.expand_path("../lib", __FILE__)
2
+ require "yun/version"
3
+
4
+ Gem::Specification.new do |gem|
5
+
6
+ gem.name = "yun"
7
+ gem.summary = "A command line tool to manage Amazon cloud service"
8
+ gem.authors = ["Feng Zhichao"]
9
+ gem.email = ["flankerfc@gmail.com"]
10
+ gem.homepage = "https://github.com/flanker/yun"
11
+
12
+ gem.version = Yun::VERSION
13
+ gem.platform = Gem::Platform::RUBY
14
+
15
+ gem.require_path = "lib"
16
+ gem.files = `git ls-files`.split("\n")
17
+ gem.executables = "yun"
18
+
19
+ gem.add_runtime_dependency "fog", ">= 1.0.0"
20
+ gem.add_runtime_dependency 'hirb', '~> 0.4.5'
21
+ gem.add_runtime_dependency 'thor', '>= 0.14.0'
22
+ end
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yun
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Feng Zhichao
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-11-13 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: fog
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 23
29
+ segments:
30
+ - 1
31
+ - 0
32
+ - 0
33
+ version: 1.0.0
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: hirb
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 5
45
+ segments:
46
+ - 0
47
+ - 4
48
+ - 5
49
+ version: 0.4.5
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: thor
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 39
61
+ segments:
62
+ - 0
63
+ - 14
64
+ - 0
65
+ version: 0.14.0
66
+ type: :runtime
67
+ version_requirements: *id003
68
+ description:
69
+ email:
70
+ - flankerfc@gmail.com
71
+ executables:
72
+ - yun
73
+ extensions: []
74
+
75
+ extra_rdoc_files: []
76
+
77
+ files:
78
+ - .rvmrc
79
+ - Gemfile
80
+ - Gemfile.lock
81
+ - bin/yun
82
+ - lib/yun.rb
83
+ - lib/yun/cli.rb
84
+ - lib/yun/commands/node_command.rb
85
+ - lib/yun/version.rb
86
+ - lib/yun/yun.rb
87
+ - yun.gemspec
88
+ homepage: https://github.com/flanker/yun
89
+ licenses: []
90
+
91
+ post_install_message:
92
+ rdoc_options: []
93
+
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ hash: 3
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ requirements: []
115
+
116
+ rubyforge_project:
117
+ rubygems_version: 1.8.10
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: A command line tool to manage Amazon cloud service
121
+ test_files: []
122
+