nodester 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,17 +1,19 @@
1
1
 
2
- WARNING: NOT RELEASED YET
2
+ WARNING: First version and my first published gem - need to work on docs and specs.
3
3
 
4
- = Nodester
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
- == Install
8
+ [![Build Status](http://travis-ci.org/scottyapp/nodester.png)](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
- == Use
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
- == Dependencies
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
- == Contributing to nodester
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
@@ -166,8 +166,10 @@ module Nodester
166
166
  handle_result self.class.get('/env', options)
167
167
  end
168
168
 
169
- def update_npm(action,package)
170
- options={:body => {:action => action,:package=>package},:basic_auth => @auth}
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
 
@@ -1,3 +1,3 @@
1
1
  module Nodester
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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
@@ -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 => {
@@ -0,0 +1,5 @@
1
+ HTTP/1.1 200 OK
2
+ Status: 200
3
+ Content-Type: application/json; charset=utf-8
4
+
5
+ {"status":"success","output":"stdout: express@2.4.3 ./node_modules/express \n"}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nodester
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
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