chartd 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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/{LICENSE → LICENSE.md} +0 -0
- data/README.md +22 -0
- data/chartd.gemspec +1 -1
- data/lib/chartd/chart.rb +1 -1
- data/test/test_chartd.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ee60edcb90d712a493f2a79731d697810193e09
|
4
|
+
data.tar.gz: a8cbe8eeb202727f796775e2c741bd730e0346a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78079f475d599ad60c00cccaa7ad950ccd20115fb329b5b7a267e2639c13eef31c2bfc4afc32037edb77a90dbe4cdffeb04c5bb11f37bffa2e02bc3a1e554ef6
|
7
|
+
data.tar.gz: e523a5da38a3228d5d175448fd882a2e32ee7eb877b24a79a0f90bf3237dd9b081861ae6c7df9603ea783cb82dd85e8abd876098ba944a21134cb1688dd1d12b
|
data/Gemfile.lock
CHANGED
data/{LICENSE → LICENSE.md}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# `chartd-rb` – Encode data for chartd.co
|
2
2
|
|
3
3
|
[](https://travis-ci.org/commissure/chartd-rb)
|
4
|
+
[](https://rubygems.org/gems/chartd)
|
4
5
|
|
5
6
|
:chart_with_upwards_trend: `chartd-rb` is a Ruby gem for [chartd.co],
|
6
7
|
a service from [@stathat], that allows you to creat a chart by encoding
|
@@ -18,6 +19,27 @@ chart looks like this:
|
|
18
19
|
|
19
20
|
<img src="https://chartd.co/a.png?w=580&h=180&d0=SRWfaZHLHEDABKKTUYgpqqvws0138eZfaYtwxxsxyst&ymin=94.48&ymax=103.3">
|
20
21
|
|
22
|
+
## Installation
|
23
|
+
|
24
|
+
|
25
|
+
Add this line to your application’s Gemfile:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
gem 'chartd'
|
29
|
+
```
|
30
|
+
|
31
|
+
And then execute:
|
32
|
+
|
33
|
+
```shell
|
34
|
+
$ bundle
|
35
|
+
```
|
36
|
+
|
37
|
+
Or install it yourself as:
|
38
|
+
|
39
|
+
```shell
|
40
|
+
$ gem install chartd
|
41
|
+
```
|
42
|
+
|
21
43
|
|
22
44
|
## Usage
|
23
45
|
|
data/chartd.gemspec
CHANGED
data/lib/chartd/chart.rb
CHANGED
@@ -15,11 +15,11 @@ class Chartd
|
|
15
15
|
|
16
16
|
def initialize(dataset = [], min: nil, max: nil, ylabels: true, options: {})
|
17
17
|
raise ERR_BAD_DATASET unless dataset.is_a?(Array)
|
18
|
-
raise ERR_TOO_MANY_DATASETS if dataset.count > 5
|
19
18
|
|
20
19
|
# Check if dataset is multidimensional and if so, use it as is.
|
21
20
|
# Otherwise make it multidimensional.
|
22
21
|
if dataset[0].is_a?(Array)
|
22
|
+
raise ERR_TOO_MANY_DATASETS if dataset.count > 5
|
23
23
|
@dataset = dataset
|
24
24
|
else
|
25
25
|
@dataset = [dataset]
|
data/test/test_chartd.rb
CHANGED
@@ -6,7 +6,7 @@ require 'chartd'
|
|
6
6
|
class ChartdTest < Test::Unit::TestCase
|
7
7
|
def test_chart
|
8
8
|
expected = 'https://chartd.co/a.png?w=580&h=180&ymin=1.2&ymax=3.1&d0=Am9'
|
9
|
-
chart = Chartd::Chart.new([1.2, 2.4, 3.1])
|
9
|
+
chart = Chartd::Chart.new([1.2, 2.4, 3.1, 4.8, 9.1, 2.2, 2.0])
|
10
10
|
|
11
11
|
assert_equal expected, chart.url
|
12
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chartd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Lielje
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -64,7 +64,7 @@ files:
|
|
64
64
|
- ".travis.yml"
|
65
65
|
- Gemfile
|
66
66
|
- Gemfile.lock
|
67
|
-
- LICENSE
|
67
|
+
- LICENSE.md
|
68
68
|
- README.md
|
69
69
|
- Rakefile
|
70
70
|
- chartd.gemspec
|