motion_yak 0.0.2 → 0.0.3

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- motion_yak (0.0.2)
4
+ motion_yak (0.0.3)
5
5
  bubble-wrap
6
6
 
7
7
  GEM
@@ -0,0 +1,11 @@
1
+ module MotionYak
2
+ module JSON
3
+ def self.encode(json)
4
+ BW::JSON.generate(json)
5
+ end
6
+
7
+ def self.decode(json)
8
+ BW::JSON.parse(json)
9
+ end
10
+ end
11
+ end
@@ -2,23 +2,33 @@ module MotionYak
2
2
  module Request
3
3
  def self.get(url)
4
4
  BW::HTTP.get(url) do |response|
5
- p response.body.to_str
5
+ json = parse(response)
6
+ return json
6
7
  end
7
8
  end
8
9
  def self.put(url, data)
9
10
  BW::HTTP.put(url, {payload: data}) do |response|
10
- p response.body.to_str
11
+ json = parse(response)
12
+ return json
11
13
  end
12
14
  end
13
15
  def self.post(url, data)
14
16
  BW::HTTP.post(url, {payload: data}) do |response|
15
- p response.body.to_str
17
+ json = parse(response)
18
+ return json
16
19
  end
17
20
  end
18
21
  def self.delete(url)
19
22
  BW::HTTP.delete(url) do |response|
20
- p response.body.to_str
23
+ json = parse(response)
24
+ return json
21
25
  end
22
26
  end
27
+
28
+ def self.parse(string)
29
+ json = MotionYak::JSON.parse(string)
30
+ p json
31
+ json
32
+ end
23
33
  end
24
34
  end
@@ -1,5 +1,5 @@
1
1
  module MotionYak
2
- VERSION = '0.0.2' unless defined?(MotionYak::VERSION)
2
+ VERSION = '0.0.3' unless defined?(MotionYak::VERSION)
3
3
  MIN_MOTION_VERSION = '1.24'
4
4
 
5
5
  module_function
data/lib/motion_yak.rb CHANGED
@@ -13,4 +13,5 @@ module MotionYak
13
13
  end
14
14
 
15
15
  require 'motion_yak/request'
16
- require 'motion_yak/config'
16
+ require 'motion_yak/config'
17
+ require 'motion_yak/json'
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion_yak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,10 +36,12 @@ extra_rdoc_files:
36
36
  - lib/motion_yak.rb
37
37
  - lib/motion_yak/config.rb
38
38
  - lib/motion_yak/data/ca-certificate.crt
39
+ - lib/motion_yak/json.rb
39
40
  - lib/motion_yak/request.rb
40
41
  - lib/motion_yak/version.rb
41
42
  - motion_yak.gemspec
42
43
  - pkg/motion_yak-0.0.1.gem
44
+ - pkg/motion_yak-0.0.2.gem
43
45
  files:
44
46
  - Gemfile
45
47
  - Gemfile.lock
@@ -47,10 +49,12 @@ files:
47
49
  - lib/motion_yak.rb
48
50
  - lib/motion_yak/config.rb
49
51
  - lib/motion_yak/data/ca-certificate.crt
52
+ - lib/motion_yak/json.rb
50
53
  - lib/motion_yak/request.rb
51
54
  - lib/motion_yak/version.rb
52
55
  - motion_yak.gemspec
53
56
  - pkg/motion_yak-0.0.1.gem
57
+ - pkg/motion_yak-0.0.2.gem
54
58
  homepage: http://github.com/ballantyne/motion_yak
55
59
  licenses: []
56
60
  post_install_message:
@@ -65,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
69
  version: '0'
66
70
  segments:
67
71
  - 0
68
- hash: -4610938697304850181
72
+ hash: 1650176847988498001
69
73
  required_rubygems_version: !ruby/object:Gem::Requirement
70
74
  none: false
71
75
  requirements:
@@ -74,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
78
  version: '0'
75
79
  segments:
76
80
  - 0
77
- hash: -4610938697304850181
81
+ hash: 1650176847988498001
78
82
  requirements: []
79
83
  rubyforge_project:
80
84
  rubygems_version: 1.8.21