la_metric 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 777b1952ff723ff2f7733e8773a00150d3d7600c64b16266a846d8449d8cb7a9
4
- data.tar.gz: 85c957448e9ef4e4cb1a18c0c0784a0e9ca0645295bf117577c47756b0408a40
3
+ metadata.gz: 5524db59b4f88010551d53a1c0afc79b335f790923d88fd5c180f00466383c96
4
+ data.tar.gz: ba1748ddc43fcb033d5d29f76a3e191112689bd3a5f32b8454dbabaa190056b9
5
5
  SHA512:
6
- metadata.gz: 1739d78f2fb5ca3a2388a96275b24f79aac66f5128435b1e4dda4462975c9598884bd8547fb00eed5f31ea446dfa27255277d1a454ec23a410444f75d67419a1
7
- data.tar.gz: e2b2275d1b65b83bbf7a2915ada28c869052e57e5de28bf61e96fa0835331f030704022b028db5d29604ebcd90151071ec750d2356afa10ee45ec539ec627c07
6
+ metadata.gz: 1813289d92faf627adfeefb123d422d23d831dc0ed9c160fd38bc4ed8e2c99d074e590d817f5312370db6043875de6bc795adf03695e432b3dafee89b142152c
7
+ data.tar.gz: fec22ee069753706760c2cd2730c2b1b0086e94537559fc88eb5331aa8b3c14b1d1f2ae3bf3ef620d0779995d7863a4e90a52eea1afd1992749f7ec6ee46aae3
data/README.md CHANGED
@@ -1,2 +1,62 @@
1
- # lametric
2
1
  LaMetric
2
+ ==============
3
+
4
+ Ruby adapter for [LaMetric](https://lametric.com/) clocks
5
+
6
+
7
+ Installation
8
+ -----------------
9
+
10
+ Add to your Gemfile:
11
+
12
+ gem 'la_metric'
13
+
14
+ Or execute:
15
+
16
+ gem install la_metric
17
+
18
+
19
+ Configuration
20
+ -----------------
21
+
22
+ Configure url and access token if you want to push data to your widget:
23
+
24
+ LaMetric.configure do |config|
25
+ config.url = 'your_app_push_url'
26
+ config.access_token = 'your_access_token'
27
+ end
28
+
29
+ Or via environment variables:
30
+
31
+ LA_METRIC_URL=your_app_push_url
32
+ LA_METRIC_ACCESS_TOKEN=your_access_token
33
+
34
+
35
+ Usage
36
+ -----------------
37
+
38
+ Add your frames:
39
+
40
+ frames = LaMetric::Frames.new
41
+ frames.push('Some text')
42
+ frames.push(text: 9999, icon: 'i34', index: 0)
43
+
44
+ Push frames to widget:
45
+
46
+ LaMetric.push(frames)
47
+
48
+ Or render frames in your controller
49
+
50
+ render json: frames.to_json
51
+
52
+
53
+ Contribution
54
+ -----------------
55
+
56
+ Feel free :)
57
+
58
+
59
+ Author
60
+ -----------------
61
+
62
+ Ilia Kasianenko [@got2be](https://github.com/got2be)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'la_metric'
3
- gem.version = '0.0.1'
3
+ gem.version = '0.0.2'
4
4
  gem.date = '2019-04-30'
5
5
  gem.summary = 'LaMetric'
6
6
  gem.description = 'A gem for LaMetric smart clock'
@@ -19,7 +19,7 @@ module LaMetric
19
19
  req.headers['Accept'] = 'application/json'
20
20
  req.headers['Cache-Control'] = 'no-cache'
21
21
  req.headers['X-Access-Token'] = configuration.access_token
22
- req.body = frames.serialize
22
+ req.body = frames.to_json
23
23
  end
24
24
  end
25
25
  end
@@ -13,7 +13,7 @@ module LaMetric
13
13
  @frames << LaMetric::Frame.new(normalize(frame_data))
14
14
  end
15
15
 
16
- def serialize
16
+ def to_json
17
17
  { frames: frames }.to_json
18
18
  end
19
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: la_metric
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilia Kasianenko