nodester 0.0.1 → 0.0.2
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/README.md +10 -10
- data/lib/nodester/client.rb +4 -2
- data/lib/nodester/version.rb +1 -1
- data/spec/client_spec.rb +5 -2
- data/spec/fakeweb_helper.rb +2 -1
- data/spec/stubs/post_npm +5 -0
- metadata +3 -1
data/README.md
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
|
2
|
-
WARNING:
|
2
|
+
WARNING: First version and my first published gem - need to work on docs and specs.
|
3
3
|
|
4
|
-
|
4
|
+
## Nodester
|
5
5
|
|
6
6
|
An API wrapper for the nodester API (http://nodester.com). The initial version uses a straight approach, an ActiveResource like interface might be added if there is enough interest.
|
7
7
|
|
8
|
-
|
8
|
+
[](http://travis-ci.org/scottyapp/nodester)
|
9
|
+
|
10
|
+
## Install
|
9
11
|
|
10
12
|
Include this in your gemfile
|
11
13
|
|
12
14
|
gem 'nodester'
|
13
15
|
|
14
|
-
|
16
|
+
## Use
|
15
17
|
|
16
18
|
client = Nodester::Client.new("username","password")
|
17
19
|
client.create_app 'myappname','server.js'
|
@@ -24,24 +26,22 @@ All results are hashes, with strings (not symbols) as keys.
|
|
24
26
|
|
25
27
|
In case of an error either a ResponseError or a StandardError is raised.
|
26
28
|
|
27
|
-
|
29
|
+
## Dependencies
|
28
30
|
|
29
31
|
* Httparty
|
30
32
|
|
31
|
-
|
32
|
-
== Acknowledgments
|
33
|
+
## Acknowledgments
|
33
34
|
|
34
35
|
Thanks to
|
35
36
|
|
36
37
|
* Aaron Russel (https://github.com/aaronrussell) whose cloudapp api helped a lot (some spec code is taken verbatim)
|
37
38
|
* John Nunemaker (https://github.com/jnunemaker) for httparty and all his other contributions.
|
38
39
|
|
39
|
-
|
40
|
-
== Trivia
|
40
|
+
## Trivia
|
41
41
|
|
42
42
|
This gem was created to the tunes of Natalia Kills and Nicki Minaj.
|
43
43
|
|
44
|
-
|
44
|
+
## Contributing to nodester
|
45
45
|
|
46
46
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
47
47
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
data/lib/nodester/client.rb
CHANGED
@@ -166,8 +166,10 @@ module Nodester
|
|
166
166
|
handle_result self.class.get('/env', options)
|
167
167
|
end
|
168
168
|
|
169
|
-
|
170
|
-
|
169
|
+
# curl -X POST -u "mwawrusch:mw09543089" -d "appname=myappname&action=install&package=express" http://api.nodester.com/npm
|
170
|
+
|
171
|
+
def update_npm(appname,action,package)
|
172
|
+
options={:body => {:appname => appname,:action => action,:package=>package},:basic_auth => @auth}
|
171
173
|
handle_result self.class.post('/npm', options)
|
172
174
|
end
|
173
175
|
|
data/lib/nodester/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -101,14 +101,17 @@ describe Nodester::Client do
|
|
101
101
|
res = @client.env
|
102
102
|
end
|
103
103
|
end
|
104
|
+
=end
|
104
105
|
|
105
106
|
context "when invoking update_npm" do
|
106
107
|
it "should perform an op against the npm" do
|
107
|
-
res = @client.update_npm
|
108
|
+
res = @client.update_npm 'myappname','install','express'
|
109
|
+
res['output'].length.should > 0
|
110
|
+
res['status'].should == 'success'
|
108
111
|
end
|
109
112
|
end
|
110
113
|
|
111
|
-
|
114
|
+
=begin
|
112
115
|
context "when invoking create_appdomain" do
|
113
116
|
it "should create an app domain" do
|
114
117
|
res = @client.create_appdomain
|
data/spec/fakeweb_helper.rb
CHANGED
@@ -20,7 +20,8 @@ def fake_it_all
|
|
20
20
|
# POST URLs
|
21
21
|
:post => {
|
22
22
|
'http://nodester.com/coupon' => 'platform_post_coupon',
|
23
|
-
'http://arthur:dent@api.nodester.com/app' => 'post_app'
|
23
|
+
'http://arthur:dent@api.nodester.com/app' => 'post_app',
|
24
|
+
'http://arthur:dent@api.nodester.com/npm' => 'post_npm'
|
24
25
|
},
|
25
26
|
# PUT URLs
|
26
27
|
:put => {
|
data/spec/stubs/post_npm
ADDED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: nodester
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Martin Wawrusch
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- spec/stubs/platform_get_status
|
97
97
|
- spec/stubs/platform_post_coupon
|
98
98
|
- spec/stubs/post_app
|
99
|
+
- spec/stubs/post_npm
|
99
100
|
has_rdoc: true
|
100
101
|
homepage: http://github.com/scottyapp/nodester
|
101
102
|
licenses: []
|
@@ -143,3 +144,4 @@ test_files:
|
|
143
144
|
- spec/stubs/platform_get_status
|
144
145
|
- spec/stubs/platform_post_coupon
|
145
146
|
- spec/stubs/post_app
|
147
|
+
- spec/stubs/post_npm
|