say_it_with_graphs 0.1.0 → 0.1.1.pre.alpha.pre.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 22ec0d37012cf44ccb9bb21eb0ec4a7ff0c15fef
4
- data.tar.gz: 228761e63191d0923427a3dcd32ed10ae5405ab9
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MmM3Mzc3YWJlNTMxNGVmYjUzNDM5MDU3MjMzNTk3YWMxNWY4ZmQ4Ng==
5
+ data.tar.gz: !binary |-
6
+ ZmUzMzAxODAwNWVjYWExMmU4NjQ4ZTRkNmU3NjBmNmI2N2Y1ZTA3NA==
5
7
  SHA512:
6
- metadata.gz: b104f125fac78b4e2dfb6d7686c9154bf75bda780092dd56ad143f98a02acb34a133d69eb24205809b2a44f0c3423ce54e3347661ac13526be6e9d9d09adafbe
7
- data.tar.gz: 5b0a6f283985266caaa7955d818649365afd5228ca96e9c7e3459792349b365311881e11f1d4ac5c0e7355ce886cb5ed4a5f46afdd64d23f944f04f0f3e0580c
8
+ metadata.gz: !binary |-
9
+ MzJjMzNiODdmZTQxZWJkYmE4N2M4Y2JhMzI2NjJlZjBiYmU2MGNlOTgyZDRl
10
+ OWI4MTA3ZThmOTYwMGZmYWUwY2Q5YjJlZDE3ZTcwMjk2ZGNiZjNmMDM4NGEw
11
+ MzQwNTc3MzBiNTEwYmI2MDJkNGVjMzQyNzVlZGVkNjM0YmQ5ZWU=
12
+ data.tar.gz: !binary |-
13
+ NTY5ZGFlZTVlNjNmODhkN2MwMzg4NzZmNzc1YjM3N2EwZGM0ZjZjYjY5NGZk
14
+ Mzk3NzlmYTVkM2E0MTI4Y2UzYWRkMmQzMzliZWMwZWUyMTM5OWU5MTk1NjQw
15
+ Nzk2MzQ0ZTkxOTBlNjUwMzhmMGI3ZTljNmU3Y2I0OGIyMGE0ZTI=
data/.travis.yml CHANGED
@@ -7,3 +7,11 @@ rvm:
7
7
  - 2.0
8
8
  - 2.1
9
9
  - 2.2
10
+
11
+ deploy:
12
+ provider: rubygems
13
+ api_key:
14
+ secure: LcWSsGG1GhvdlDz0A9x02EcszoaS3bT7666XlN0s2bH713AWHNMIdK0GKQivpHdDFOzg6bj/UwSikWGaF/F01B8pnEmVxQoMLqudrjBIbnMpkZVcXNarP3oLOuPI+QdF6VEX4v9mrtjUd1nTTitMGn3DDk3gDhRRYbPIg5/UhkA=
15
+ gem: say_it_with_graphs
16
+ on:
17
+ repo: nesQuick/say-it-with-graphs
data/README.md CHANGED
@@ -1,10 +1,20 @@
1
1
  # SayItWithGraphs [![Build Status](https://travis-ci.org/nesQuick/say-it-with-graphs.svg?branch=master)](https://travis-ci.org/nesQuick/say-it-with-graphs)
2
2
 
3
- TODO: Write a gem description
3
+ Use [Librato Metrics](https://www.librato.com) to finally say something which should have been said long before.
4
+
5
+ ![](http://cl.ly/image/1F3B371E3r0v/2015-03-09%2000_57_07.gif)
6
+
7
+ **Note: not all characters are supported yet, please feel free to contribute some. check `lib/say_it_with_graphs/characters` for available characters.**
4
8
 
5
9
  ## Installation
6
10
 
7
- Add this line to your application's Gemfile:
11
+ Install it yourself as:
12
+
13
+ ```bash
14
+ $ gem install say_it_with_graphs
15
+ ```
16
+
17
+ Or add this line to your application's Gemfile:
8
18
 
9
19
  ```ruby
10
20
  gem 'say_it_with_graphs'
@@ -12,19 +22,102 @@ gem 'say_it_with_graphs'
12
22
 
13
23
  And then execute:
14
24
 
15
- $ bundle
25
+ ```bash
26
+ $ bundle
27
+ ```
28
+
29
+ ### Configure
30
+
31
+ You need `LIBRATO_USER` and `LIBRATO_TOKEN` in your environment in order to make it work :sparkles:
16
32
 
17
- Or install it yourself as:
33
+ You can find your tokens here: https://metrics.librato.com/account/api_tokens or simply create a new one.
18
34
 
19
- $ gem install say_it_with_graphs
35
+ ## Quick Start
36
+
37
+ Getting started in 5 minutes.
38
+
39
+ ```bash
40
+ $ gem 'say_it_with_graphs'
41
+ $ export LIBRATO_USER='<your user email here>'
42
+ $ export LIBRATO_TOKEN='<your api token here>'
43
+ $ say-it-with-graphs "I <3 GRAPHS\!"
44
+ "making 'I <3 GRAPHS!' with <3 and graphs"
45
+ "Painting to say-it-with-graphs-82 ... ETA: 29 minutes"
46
+ "=> https://metrics.librato.com/metrics/say-it-with-graphs-82"
47
+ "Frame 0 of 29"
48
+ "Line[9f9845] pos: 0"
49
+ "Line[9f9845] pos: 100"
50
+ "Line[9f9845] pos: 0"
51
+ "Frame 1 of 29"
52
+ "Frame 2 of 29"
53
+ "Line[27018a] pos: 50"
54
+ "Line[db03f4] pos: 50"
55
+ ...........
56
+ ```
57
+
58
+ `say-it-with-graphs` will paint your sentence onto a graph. you can find the url in the output.
20
59
 
21
60
  ## Usage
22
61
 
23
- TODO: Write usage instructions here
62
+ The usage of the execuatable is described at [Quick Start](#Quick-Start). In this section we will discuss the API to create your own characters in `lib/say_it_with_graphs/characters`.
63
+
64
+ ### The frame
65
+
66
+ Every frame has access to unlimited amount of lines. The most characters can be drawn with 2 or 3. Every character has to respond to two methods:
67
+
68
+ 1. `define`
69
+ Defines returns the character which will be mathed against the user input.
70
+
71
+ ```ruby
72
+ def define
73
+ 'i'
74
+ end
75
+ ```
76
+
77
+ 2. `draw`
78
+ Draw does the actual magic. When you have the `SayItWithGraphs::GraphControls` included in your class, you can just call the `frame` method and pass it a block which gets a `frame` passed to it. As mentioned above the frame has access to a unlimited number of lines, you can access them in several ways, the easiest is `f.line` which gives back a `Line` object, you can set it's source with `[]` (defaults to 0).
79
+
80
+ ```ruby
81
+ def draw
82
+ frame do |f|
83
+ f.line.at 0
84
+ f.line.at 100
85
+ f.line.at 0
86
+ end
87
+ end
88
+ ```
89
+
90
+ With this methods given, only graphs with a limited number of lines would be possible. It's hard to draw the characters with a single line (one could try implementing cursive handwriting). You have also access to a helper method called `rnd_line` which gives a key one can use to refer to a line which will not be used at other places in the drawning.
91
+
92
+ ```ruby
93
+ def define
94
+ 'l'
95
+ end
96
+
97
+ def draw
98
+ a = rnd_line
99
+ frame do |f|
100
+ f.line[a].at 100
101
+ f.line[a].at 0
102
+ end
103
+ frame do |f|
104
+ f.line[a].at 0
105
+ end
106
+ frame do |f|
107
+ f.line[a].at 0
108
+ end
109
+ end
110
+ ```
111
+
112
+ You can check out more complex examples like `lib/say_it_with_graphs/characters/r.rb` to see what's possible.
113
+
114
+ ## Disclaimer
115
+
116
+ This is a weekend hack. There are a few ways this thing could be improved.
24
117
 
25
118
  ## Contributing
26
119
 
27
- 1. Fork it ( https://github.com/[my-github-username]/say_it_with_graphs/fork )
120
+ 1. Fork it ( https://github.com/nesQuick/say_it_with_graphs/fork )
28
121
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
122
  3. Commit your changes (`git commit -am 'Add some feature'`)
30
123
  4. Push to the branch (`git push origin my-new-feature`)
@@ -8,6 +8,7 @@ module SayItWithGraphs
8
8
  # debug_output $stdout
9
9
 
10
10
  def self.submit value: value, source: source, name: 'say-it-with-graphs'
11
+ fail 'please provide valid credentials' unless ENV['LIBRATO_USER'] && ENV['LIBRATO_TOKEN']
11
12
  auth = { username: ENV['LIBRATO_USER'], password: ENV['LIBRATO_TOKEN'] }
12
13
  metric = {
13
14
  gauges: [{
@@ -1,3 +1,3 @@
1
1
  module SayItWithGraphs
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -6,6 +6,7 @@ require 'say_it_with_graphs/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "say_it_with_graphs"
8
8
  spec.version = SayItWithGraphs::VERSION
9
+ spec.version = "#{spec.version}-alpha-#{ENV['TRAVIS_BUILD_NUMBER']}" if ENV['TRAVIS']
9
10
  spec.authors = ["Ole Michaelis"]
10
11
  spec.email = ["Ole.Michaelis@googlemail.com"]
11
12
  spec.summary = %q{Make more of your graphs. Write with them!}
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: say_it_with_graphs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1.pre.alpha.pre.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ole Michaelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.13'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.7'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.12'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.12'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: guard-rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '4.5'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '4.5'
97
97
  description: say-it-with-graphs let you actually write into a place where usually
@@ -103,9 +103,9 @@ executables:
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - ".gitignore"
107
- - ".rspec"
108
- - ".travis.yml"
106
+ - .gitignore
107
+ - .rspec
108
+ - .travis.yml
109
109
  - Gemfile
110
110
  - Guardfile
111
111
  - LICENSE.txt
@@ -154,17 +154,17 @@ require_paths:
154
154
  - lib
155
155
  required_ruby_version: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - ! '>='
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - ">="
162
+ - - ! '>'
163
163
  - !ruby/object:Gem::Version
164
- version: '0'
164
+ version: 1.3.1
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.2.0
167
+ rubygems_version: 2.4.5
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Make more of your graphs. Write with them!