computering 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: d13edc9482c52c1b00141f73e6ace9b3110de791
4
- data.tar.gz: cc408c711fdeafb68511ce4d81ae9d608439f5d7
3
+ metadata.gz: 8e98f1c71acd06cb613cc21138cdab140372dd26
4
+ data.tar.gz: 423e8f75953fe82b70c3f97012714c5baf029bb7
5
5
  SHA512:
6
- metadata.gz: 4b56fde80f029c0ebf9947c9289076c62e8f0c90da539ab9e26c1b47ae7480ea42e547705cdb806dcb53902e2746c03cb43f8176b7bd92e6b3ee65f9bfc08ed2
7
- data.tar.gz: 951a7b2a5d3db91b742babb63148a43f60cbb3c13c1f137a2149c919599c2628622413cb647ed17389249426f4272400f3d48ece8cd085370177a03798492011
6
+ metadata.gz: 7637cd244bab9d7aa8d7059f437c3a913c6ad710e5f27688d48683a4f8b94607fce7d4899fcc5d2bdd13ed41e6444c2b0b664f0f251d944eb4bd90d77b26e169
7
+ data.tar.gz: 80866c5042f4a81a578ddccb270e653b99f68c08b72c2f772d1303b8e34364ae9d1192ff682f0ae3c7fea1702c7a2eb7841f76c188addfd792a0491aa57f9d41
data/README.md CHANGED
@@ -4,19 +4,14 @@
4
4
 
5
5
  # Usage
6
6
 
7
+ [![Gem Version](https://badge.fury.io/rb/computering.svg)](http://badge.fury.io/rb/computering)
8
+
7
9
  Installing the gem:
8
10
 
9
11
  ```
10
12
  gem install computering
11
13
  ```
12
14
 
13
- or via Bundler
14
-
15
- ```ruby
16
- #Gemfile
17
- gem "computering"
18
- ```
19
-
20
15
  create a presentation file
21
16
 
22
17
  ```
@@ -34,6 +29,19 @@ and run it with the `computering` command:
34
29
  computering preso.rb
35
30
  ```
36
31
 
32
+ # DSL
33
+
34
+ Please have a look at the dsl.rb file and the examples folder for how to use the DSL.
35
+
36
+ Supported commands are:
37
+
38
+ * headline (underlined text output)
39
+ * paragraph (simple text output)
40
+ * link (opens a page via `open`)
41
+ * command (runs a shell command and captures the output)
42
+ * code (syntaxhighlights ruby code)
43
+ * spec (runs inline minitest-spec)
44
+
37
45
  # TODO
38
46
 
39
47
  * syntax-check
@@ -7,11 +7,15 @@ require "computering"
7
7
  abort "USAGE: computering file [file ...]" if ARGV.empty?
8
8
 
9
9
  begin
10
- puts "", "Start typing or exit with Ctrl+C", ""
10
+ puts "", "Start typing or exit with Ctrl+C, reload with Ctrl+R", ""
11
11
  ARGV.each do |cmd|
12
12
  cmd = Computering::Cmd.new ARGV[0]
13
13
  cmd.execute
14
14
  end
15
+ puts "", ">> github.com/phoet/computering <<", ""
15
16
  rescue Computering::Cmd::Exit
16
17
  puts "", "KTHXBYE!"
18
+ rescue Computering::Cmd::Reload
19
+ puts "", "RELOAD!", ""
20
+ retry
17
21
  end
@@ -17,11 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
+ spec.add_dependency "bundler", "~> 1.5"
20
21
  spec.add_dependency "rainbow", "~> 2.0"
21
22
  spec.add_dependency "sorcerer", "~> 1.0"
22
23
  spec.add_dependency "minitest", "~> 5.2"
23
24
  spec.add_dependency "rouge", "~> 1.3"
24
25
 
25
- spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "rake", "~> 10.1"
27
27
  end
@@ -0,0 +1,106 @@
1
+ headline 'BYOL - B ring Y our O wn L ogging'
2
+
3
+ paragraph 'papertrail like addon in 15 minutes'
4
+
5
+ headline 'TOPICS'
6
+
7
+ list [
8
+ 'log-drains',
9
+ 'heroku addon-api',
10
+ 'kensa gem',
11
+ 'addon-portal',
12
+ ]
13
+
14
+
15
+ headline 'LOG-DRAINS'
16
+
17
+ command 'cd ~/o && heroku info | head -n8'
18
+
19
+ command 'cd ~/o && heroku drains'
20
+
21
+ command 'cd ~/o && heroku addons:open papertrail'
22
+
23
+ link 'heroku log drains', 'https://devcenter.heroku.com/articles/log-drains'
24
+
25
+ link 'accessing logs', 'https://devcenter.heroku.com/articles/accessing-app-logs'
26
+
27
+
28
+ headline 'HEROKU ADDON-API'
29
+
30
+ paragraph 'RESTful HTTP'
31
+
32
+ list [
33
+ "PROVISION => post '/heroku/resources'",
34
+ "DEPROVISION => delete '/heroku/resources/:id'",
35
+ "PLAN CHANGE => put '/heroku/resources/:id'",
36
+ "SSO => get '/heroku/resources/:id'",
37
+ "SSO LOGIN => post '/sso/login'",
38
+ "SSO INDEX => get '/'",
39
+ ]
40
+
41
+
42
+ headline 'KENSA GEM'
43
+
44
+ command 'gem install kensa'
45
+
46
+ command 'kensa 2>&1 | head -n7'
47
+
48
+ code("kensa create ADDON_NAME --template TEMPLATE_NAME")
49
+
50
+ list [
51
+ 'sinatra',
52
+ 'node',
53
+ 'clojure',
54
+ 'go',
55
+ ]
56
+
57
+ link 'sinatra template', 'https://github.com/heroku/kensa-create-sinatra/blob/master/app.rb#L47-L119'
58
+
59
+ code("kensa create let-it-drain --template sinatra")
60
+
61
+ command 'cd ~/l && jq "." -C addon-manifest.json'
62
+
63
+ paragraph 'some customizations'
64
+
65
+ list [
66
+ 'persistance with mongodb',
67
+ 'https syslog endpoint',
68
+ 'websocket connection',
69
+ ]
70
+
71
+ link 'addon code', 'https://github.com/phoet/let-it-drain/blob/master/app/app.rb#L67-L131'
72
+
73
+ paragraph 'see it in action'
74
+
75
+ command 'cd ~/l && bin/clear'
76
+ command 'cd ~/l && kensa sso 554e15e9776f725044000000'
77
+ command 'cd ~/l && rougify bin/log'
78
+ command 'cd ~/l && bin/log'
79
+
80
+ link 'provisioning', 'https://devcenter.heroku.com/articles/building-a-heroku-add-on#provisioning'
81
+
82
+ command 'cd ~/l && kensa test provision'
83
+ command 'cd ~/l && kensa test all'
84
+ command 'cd ~/l && rougify use_let_it_drain.rb'
85
+ command 'cd ~/l && kensa run ruby use_let_it_drain.rb'
86
+ command 'cd ~/l && heroku addons:open papertrail'
87
+ command 'cd ~/l && kensa run --production ruby use_let_it_drain.rb'
88
+
89
+
90
+ headline 'PORTAL'
91
+
92
+ link 'submit to heroku', 'https://devcenter.heroku.com/articles/submitting-an-add-on#2-submit-manifest-to-heroku'
93
+
94
+ link 'management portal', 'https://addons.heroku.com/provider/addons/let-it-drain/overview'
95
+
96
+ command 'cd ~/o && heroku addons:destroy let-it-drain --confirm onruby'
97
+ command 'cd ~/o && heroku addons:create let-it-drain:test'
98
+ command 'cd ~/o && heroku drains'
99
+ command 'cd ~/o && heroku addons:open let-it-drain'
100
+ command 'curl -sS http://hamburg.onruby.de > /dev/null'
101
+
102
+ command 'cowsay -f bunny Questions'
103
+
104
+ link 'computering', 'https://github.com/phoet/computering#computering'
105
+
106
+ command 'cowsay -f dragon KTHXBYE'
@@ -3,8 +3,10 @@ require "io/console"
3
3
  module Computering
4
4
  class Cmd
5
5
  class Exit < StandardError; end
6
+ class Reload < StandardError; end
6
7
 
7
8
  CONTROL_C = 3
9
+ CONTROL_R = 18
8
10
  ENTER = 13
9
11
 
10
12
  def initialize(file, stdin = STDIN, stdout = STDOUT)
@@ -26,6 +28,7 @@ module Computering
26
28
  @stdout.write item.padding if item.padding
27
29
  while char = io.getch
28
30
  raise Exit if char.ord == CONTROL_C
31
+ raise Reload if char.ord == CONTROL_R
29
32
  if char.ord == ENTER
30
33
  @stdout.puts item[i..-1]
31
34
  item.execute
@@ -1,3 +1,3 @@
1
1
  module Computering
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,79 +1,79 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: computering
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Schröder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-10 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rainbow
14
+ name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '1.5'
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
- version: '2.0'
26
+ version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: sorcerer
28
+ name: rainbow
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: minitest
42
+ name: sorcerer
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.2'
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.2'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rouge
56
+ name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
61
+ version: '5.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.3'
68
+ version: '5.2'
69
69
  - !ruby/object:Gem::Dependency
70
- name: bundler
70
+ name: rouge
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.3'
76
- type: :development
76
+ type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
@@ -109,6 +109,7 @@ files:
109
109
  - Rakefile
110
110
  - bin/computering
111
111
  - computering.gemspec
112
+ - example/byol.rb
112
113
  - example/middleware.rb
113
114
  - example/preso.rb
114
115
  - example/socoded.rb
@@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
150
  version: '0'
150
151
  requirements: []
151
152
  rubyforge_project:
152
- rubygems_version: 2.2.0
153
+ rubygems_version: 2.4.5
153
154
  signing_key:
154
155
  specification_version: 4
155
156
  summary: pretends you could type really fast
@@ -157,4 +158,3 @@ test_files:
157
158
  - test/config_test.rb
158
159
  - test/dsl/text_test.rb
159
160
  - test/test_helper.rb
160
- has_rdoc: