lapiz 1.0.0 → 1.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lapiz.rb +21 -3
  3. data/lib/lapiz/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7962443bbda79bd48219d63b261ff4bead15429
4
- data.tar.gz: 33d0a913c948c92b8e693abf592f7d38f052f769
3
+ metadata.gz: f0ab0b44e4874b9bdfc660a8a5aac8d713590293
4
+ data.tar.gz: 9d06ae27e0b93082aabb4c5a7f38ce21a969b1c2
5
5
  SHA512:
6
- metadata.gz: 745e5b576c5f170f9702dfc62ec136fa9fbae143b096d9ba67b882eba1f9df4065c94329b204eba9468134bdac314fdabc4236f6617a5020bb87437defe3506e
7
- data.tar.gz: 719f14a38c5eab259552aeffb19727e223c1e63d8b2d2dcd67ed758c54fd012654535b5cd2b485ab339c2944834ed339ee5938a78ed63b4ae120042338171ee7
6
+ metadata.gz: b4b1ec0a78f21c60d0b38280c8601e374b03fb72172b2063dc63f7d02edddb3464e514016c9d249da59393eee255119a817098e8649f80efca6b7155a64f1a93
7
+ data.tar.gz: eb4b20fc26669e158fc1364461845e259f90810a5c8821bb3fecffeb4373faa6a7a4c237e6562b6ead964fca5107dd85309d0b8f79bae629da73794520751c78
data/lib/lapiz.rb CHANGED
@@ -31,13 +31,13 @@ class Hash
31
31
  end
32
32
 
33
33
  new_hash = new_hash.to_a.map{ |e|
34
- if e[0].include?(",")
34
+ if e[0].to_s.include?(",")
35
35
  main = e[0].split(",").first
36
36
  rest = e[0].split(",")[1..-1]
37
37
  rest_string = rest.map{ |r| "[#{r}]" }.join("")
38
38
  ["#{main}#{rest_string}", e[1]]
39
39
  else
40
- e
40
+ [e[0].to_s, e[1]]
41
41
  end
42
42
  }.to_h
43
43
 
@@ -70,7 +70,25 @@ module Lapiz
70
70
  http_call(:post, path, params, &block)
71
71
  end
72
72
 
73
+ def patch(path, params, &block)
74
+ http_call(:patch, path, params, &block)
75
+ end
76
+
77
+ def put(path, params, &block)
78
+ http_call(:put, path, params, &block)
79
+ end
80
+
81
+ def delete(path, params, &block)
82
+ http_call(:delete, path, params, &block)
83
+ end
84
+
73
85
  def http_call(method, path, params, &block)
86
+ if block.nil?
87
+ config = YAML.load(IO.read("config.yml"))
88
+ base_uri = config["server"]["base_uri"]
89
+ return HTTParty.send(method, base_uri + path, params)
90
+ end
91
+
74
92
  it "tests action '#{path}'", self do |group|
75
93
  expect {
76
94
  @response = HTTParty.send(method, group.metadata[:base_uri] + path, params)
@@ -111,7 +129,7 @@ module Lapiz
111
129
  end
112
130
  end
113
131
 
114
- if @response.body
132
+ if @response.body && (@response.code / 100 == 2)
115
133
  fp.puts
116
134
  fp.puts "+ Response #{@response.code} (#{@response.content_type})"
117
135
  fp.puts
data/lib/lapiz/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lapiz
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lapiz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ajith Hussain