slapshot 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,6 @@
1
+ = slapshot
2
+
3
+ Describe your project here
4
+
5
+ :include:slapshot.rdoc
6
+
data/bin/slapshot ADDED
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ begin # XXX: Remove this begin/rescue before distributing your app
4
+ require 'slapshot'
5
+ rescue LoadError
6
+ STDERR.puts "In development, you need to use `bundle exec bin/todo` to run your app"
7
+ STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
8
+ STDERR.puts "Feel free to remove this message from bin/slapshot now"
9
+ exit 64
10
+ end
11
+
12
+ include GLI::App
13
+
14
+ program_desc 'A command line interface to the Appshot API'
15
+
16
+ version Slapshot::VERSION
17
+
18
+ desc 'Your Appshot url'
19
+ flag [:url]
20
+
21
+ desc 'Your Appshot instance'
22
+ flag [:i,:instance]
23
+
24
+ desc 'Your Appshot username'
25
+ flag [:u,:username]
26
+
27
+ desc 'Your Appshot password'
28
+ flag [:p,:password]
29
+
30
+ desc 'Search your instance of Appshot'
31
+ arg_name 'Pass in the query'
32
+ command :search do |c|
33
+
34
+ c.desc 'Limit the search to this application or group'
35
+ c.flag [:a, :app]
36
+
37
+ c.desc 'Export the results to an Excel file with the given name'
38
+ c.flag [:x, :xls]
39
+
40
+ c.desc 'The maximum number of results the search should return'
41
+ c.default_value 20
42
+ c.flag [:c, :count]
43
+
44
+ c.action do |global_options,options,args|
45
+
46
+ if options[:a]
47
+ @sc.set_app options[:a]
48
+ end
49
+
50
+ if args.length != 1
51
+ raise 'The search command takes exactly one argument: the query'
52
+ end
53
+
54
+ r = @sc.search args[0], options[:c]
55
+
56
+ if options[:x]
57
+ @sc.to_xls r, options[:x]
58
+ puts "Exported search results to #{options[:x]}"
59
+ else
60
+ puts @sc.to_table r
61
+ end
62
+ end
63
+ end
64
+
65
+ desc 'Describe upload here'
66
+ arg_name 'Describe arguments to upload here'
67
+ command :upload do |c|
68
+ c.action do |global_options,options,args|
69
+ puts "upload command ran"
70
+ end
71
+ end
72
+
73
+ pre do |global,command,options,args|
74
+ # Pre logic here
75
+ # Return true to proceed; false to abort and not call the
76
+ # chosen command
77
+ # Use skips_pre before a command to skip this block
78
+ # on that command only
79
+
80
+ url = global[:url] || ENV['APPSHOT_URL'] || "https://api.appshot.com"
81
+ instance = global[:i] || ENV['APPSHOT_INSTANCE']
82
+ username = global[:u] || ENV['APPSHOT_USERNAME']
83
+ password = global[:p] || ENV['APPSHOT_PASSWORD']
84
+
85
+ @sc = SlapshotConnection.new url, instance, username, password
86
+
87
+ true
88
+ end
89
+
90
+ post do |global,command,options,args|
91
+ # Post logic here
92
+ # Use skips_post before a command to skip this
93
+ # block on that command only
94
+ end
95
+
96
+ on_error do |exception|
97
+ # Error logic here
98
+ # return false to skip default error handling
99
+ true
100
+ end
101
+
102
+ exit run(ARGV)
data/lib/slapshot.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'slapshot/version.rb'
2
+ require 'slapshot/main.rb'
@@ -0,0 +1,3 @@
1
+ module Slapshot
2
+ VERSION = '0.0.1'
3
+ end
data/slapshot.rdoc ADDED
@@ -0,0 +1,5 @@
1
+ = slapshot
2
+
3
+ Generate this with
4
+ slapshot rdoc
5
+ After you have described your command line interface
metadata ADDED
@@ -0,0 +1,189 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slapshot
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mik Lernout
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-10-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !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: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rdoc
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: aruba
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: gli
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - '='
68
+ - !ruby/object:Gem::Version
69
+ version: 2.4.0
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - '='
76
+ - !ruby/object:Gem::Version
77
+ version: 2.4.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rest-client
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - '='
84
+ - !ruby/object:Gem::Version
85
+ version: 1.6.7
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - '='
92
+ - !ruby/object:Gem::Version
93
+ version: 1.6.7
94
+ - !ruby/object:Gem::Dependency
95
+ name: json
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - '='
100
+ - !ruby/object:Gem::Version
101
+ version: 1.7.5
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - '='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.7.5
110
+ - !ruby/object:Gem::Dependency
111
+ name: formatador
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 0.2.3
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - '='
124
+ - !ruby/object:Gem::Version
125
+ version: 0.2.3
126
+ - !ruby/object:Gem::Dependency
127
+ name: spreadsheet
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - '='
132
+ - !ruby/object:Gem::Version
133
+ version: 0.7.4
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - '='
140
+ - !ruby/object:Gem::Version
141
+ version: 0.7.4
142
+ description: ! 'This is a command line interface to the Appshot API. I allows you
143
+ to search your Appshot instance, upload code and import/export informations.
144
+
145
+ '
146
+ email: Mik_Lernout@Dell.com
147
+ executables:
148
+ - slapshot
149
+ extensions: []
150
+ extra_rdoc_files:
151
+ - README.rdoc
152
+ - slapshot.rdoc
153
+ files:
154
+ - bin/slapshot
155
+ - lib/slapshot/version.rb
156
+ - lib/slapshot.rb
157
+ - README.rdoc
158
+ - slapshot.rdoc
159
+ homepage: http://appshot.com
160
+ licenses: []
161
+ post_install_message:
162
+ rdoc_options:
163
+ - --title
164
+ - slapshot
165
+ - --main
166
+ - README.rdoc
167
+ - -ri
168
+ require_paths:
169
+ - lib
170
+ - lib
171
+ required_ruby_version: !ruby/object:Gem::Requirement
172
+ none: false
173
+ requirements:
174
+ - - ! '>='
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ required_rubygems_version: !ruby/object:Gem::Requirement
178
+ none: false
179
+ requirements:
180
+ - - ! '>='
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ requirements: []
184
+ rubyforge_project:
185
+ rubygems_version: 1.8.24
186
+ signing_key:
187
+ specification_version: 3
188
+ summary: A command line interface to the Appshot API
189
+ test_files: []