megam_api 0.12 → 0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e565c5f554f3b29604419c0f51758171a97444a
4
- data.tar.gz: 8c915ad1bb5d1ff93225e5816a2c27b97dbc9f00
3
+ metadata.gz: a89e917fbfd15f7068d3212e2c9a6b14a689471c
4
+ data.tar.gz: 3ef8e5d63add9b4c3a8811969dd6e467a6922d1a
5
5
  SHA512:
6
- metadata.gz: 8fc940ba8296de0aacfbab4df73d2c5cd5c9e15e80f0c47f4de6cac11e8bd9638255fa765fd835b1471acebac84ea6698e9a03b07d141296dfef3a2cf4cea7fa
7
- data.tar.gz: b22382100b343abc033e667ab8659f6a125ce6f3f8d4c6bd23ba637fe2edc4e3bd0171cb9c305ca595f6b7427ca53add134957bb2a7d22a564a4ac775d8e3de6
6
+ metadata.gz: 0f0ac5caf0e46baece23ea5b71ebcf7884f5d8c29492a9339e9e934a8fefe2f90acda6e7fed27da8161e5c97b6b6c889e08f07dd944ae8baa86f0079f3b3c65a
7
+ data.tar.gz: 167c28d98d7d059b0a62118cc349ef896d3d9a6c53a6478dd5c66f45c672a381091aa3be7b9f92624881aab0c2d85648340ccb6bf90665949160f3eab178330f
@@ -19,7 +19,7 @@ module Megam
19
19
  :expects => 200,
20
20
  :method => :get,
21
21
  :body => @options[:body]
22
- )
22
+ )
23
23
  end
24
24
 
25
25
  def post_marketplaceapp(new_node)
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "0.12"
3
+ VERSION = "0.13"
4
4
  end
5
5
  end
@@ -21,9 +21,8 @@ module Megam
21
21
  @id = nil
22
22
  @name = nil
23
23
  @appdetails = {}
24
- @pricetype = nil
25
24
  @features={}
26
- @plan={}
25
+ @plans=nil
27
26
  @applinks={}
28
27
  @attach =nil
29
28
  @predefnode=nil
@@ -60,15 +59,7 @@ module Megam
60
59
  else
61
60
  @id
62
61
  end
63
- end
64
-
65
- def pricetype(arg=nil)
66
- if arg != nil
67
- @pricetype = arg
68
- else
69
- @pricetype
70
- end
71
- end
62
+ end
72
63
 
73
64
  def features(arg=nil)
74
65
  if arg != nil
@@ -78,11 +69,11 @@ module Megam
78
69
  end
79
70
  end
80
71
 
81
- def plan(arg=nil)
72
+ def plans(arg=nil)
82
73
  if arg != nil
83
- @plan = arg
74
+ @plans = arg
84
75
  else
85
- @plan
76
+ @plans
86
77
  end
87
78
  end
88
79
 
@@ -145,9 +136,8 @@ module Megam
145
136
  index_hash["id"] = id
146
137
  index_hash["name"] = name
147
138
  index_hash["appdetails"] = appdetails
148
- index_hash["pricetype"] = pricetype
149
139
  index_hash["features"] = features
150
- index_hash["plan"] = plan
140
+ index_hash["plans"] = plans
151
141
  index_hash["applinks"] = applinks
152
142
  index_hash["attach"] = attach
153
143
  index_hash["predefnode"] = predefnode
@@ -168,9 +158,8 @@ module Megam
168
158
  "id" => id,
169
159
  "name" => name,
170
160
  "appdetails" => appdetails,
171
- "pricetype" => pricetype,
172
161
  "features" => features,
173
- "plan" => plan,
162
+ "plans" => plans,
174
163
  "applinks" => applinks,
175
164
  "attach" => attach,
176
165
  "predefnode" => predefnode,
@@ -186,11 +175,11 @@ module Megam
186
175
  app.name(o["name"]) if o.has_key?("name")
187
176
  app.logo(o["logo"]) if o.has_key?("logo")
188
177
  app.catagory(o["catagory"]) if o.has_key?("catagory")
189
- app.pricetype(o["pricetype"]) if o.has_key?("pricetype")
190
178
  app.attach(o["attach"]) if o.has_key?("attach")
191
179
  app.predefnode(o["predefnode"]) if o.has_key?("predefnode")
192
180
  app.approved(o["approved"]) if o.has_key?("approved")
193
181
  app.created_at(o["created_at"]) if o.has_key?("created_at")
182
+ app.plans(o["plans"]) if o.has_key?("plans")
194
183
  #requests
195
184
  oq = o["features"]
196
185
  app.features[:feature1] = oq["feature1"] if oq && oq.has_key?("feature1")
@@ -201,13 +190,12 @@ module Megam
201
190
  oa = o["appdetails"]
202
191
  app.appdetails[:logo] = oa["logo"] if oa && oa.has_key?("logo")
203
192
  app.appdetails[:category] = oa["category"] if oa && oa.has_key?("category")
204
- app.appdetails[:version] = oa["version"] if oa && oa.has_key?("version")
205
193
  app.appdetails[:description] = oa["description"] if oa && oa.has_key?("description")
206
194
 
207
- op = o["plan"]
208
- app.plan[:price] = op["price"] if op && op.has_key?("price")
209
- app.plan[:description] = op["description"] if op && op.has_key?("description")
210
- app.plan[:plantype]= op["plantype"] if op && op.has_key?("plantype")
195
+ #op = o["plan"]
196
+ #app.plan[:price] = op["price"] if op && op.has_key?("price")
197
+ #app.plan[:description] = op["description"] if op && op.has_key?("description")
198
+ #app.plan[:plantype]= op["plantype"] if op && op.has_key?("plantype")
211
199
 
212
200
  ol = o["applinks"]
213
201
  app.applinks[:free_support] = ol["free_support"] if ol && ol.has_key?("free_support")
@@ -237,9 +225,8 @@ module Megam
237
225
  @name = o["name"] if o.has_key?("name")
238
226
  @id = o["id"] if o.has_key?("id")
239
227
  @appdetails = o["appdetails"] if o.has_key?("appdetails")
240
- @pricetype = o["pricetype"] if o.has_key?("pricetype")
241
228
  @features = o["features"] if o.has_key?("features")
242
- @plan = o["plan"] if o.has_key?("plan")
229
+ @plans = o["plans"] if o.has_key?("plans")
243
230
  @applinks = o["applinks"] if o.has_key?("applinks")
244
231
  @attach = o["attach"] if o.has_key?("attach")
245
232
  @predefnode = o["predefnode"] if o.has_key?("predefnode")
@@ -5,11 +5,10 @@ class TestMarketplaces < MiniTest::Unit::TestCase
5
5
  def test_post_marketplace
6
6
  tmp_hash = {
7
7
  "name" => "sample",
8
- "logo" => "riak.logo",
9
- "catagory" => "DB",
10
- "pricetype" => "free",
8
+ "appdetails" => {"logo" => "logo", "category"=> "catagroy", "description"=> "description"},
11
9
  "features" => {"feature1" => "feature1","feature2" => "feature2","feature3" => "feature3","feature4" => "feature4"},
12
- "plan" => {"price" => "50","description" => "description","plantype" => "free"},
10
+ "plans" => [{"price"=> "30", "description"=> "description", "plantype"=> "paid", "version"=> "0.1", "source"=> "source"}],
11
+ "applinks" => {"free_support"=> "String", "paid_support"=> "String", "home_link"=> "String", "info_link"=> "String", "content_link"=> "String", "wiki_link"=> "String", "source_link"=> "String"},
13
12
  "attach" => "attach",
14
13
  "predefnode" => "predefnode",
15
14
  "approved" => "approved" }
@@ -35,11 +34,12 @@ def test_post_marketplace
35
34
  assert_equal(200, response.status)
36
35
  end
37
36
  =end
38
-
37
+ #=begin
39
38
  def test_get_node0
40
- response = megams.get_marketplaceapp("riak")
39
+ response = megams.get_marketplaceapp("34-Trac")
41
40
  assert_equal(200, response.status)
42
41
  end
42
+ #=end
43
43
  =begin
44
44
  def test_get_node1
45
45
  response = megams.get_node("night.megam.co")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.12'
4
+ version: '0.13'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kishorekumar Neelamegam, Thomas Alrin, Subash Sethurajan, Rajthilak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-07 00:00:00.000000000 Z
11
+ date: 2014-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon