tkn2 0.0.1 → 0.1.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: 2c47a9bc8f71f08d678661bd99720f72c2fdc065
4
- data.tar.gz: 5700de099467bd9c1c45166a6ecdf7c189e1e474
3
+ metadata.gz: 5493112f82044e8673a8dd2a496c25ef9d1e7eef
4
+ data.tar.gz: 0c3fa66c4a402f5f9c65c9ea919cf76148d86622
5
5
  SHA512:
6
- metadata.gz: be808afbf8b891c5f58e59f712829a85498a80ff9758b78797e149f3ef5c1280bd32a957c00dd475258be2ceb2c4ccf32cfb6601b8d120933dad87133fbac9c8
7
- data.tar.gz: 41a2b35ebfef372eceb17213c39324cae3501e458c86521d8214fabcbe23dab3ffb683f47ff4caeb2bb9e065b1368a55e4f3eb22367f66c541812f35e8203a98
6
+ metadata.gz: d8a3a1c0651aad1537f43310dab8d7b6a9f8fd47f4841fe2507ff21fb556b680d0e1477ab8f731ffbdc641902e29b6bf1cc170b0b12075cb1a56abe00fd39377
7
+ data.tar.gz: 0f48252aff1bcb5b2f7e4c18e6408e859c4ff0fbee4408d24c7f184bae39e80f63083022f23f882b36a4e5a719ae894f7bdc97d1d510a839956bc4a20aa99fc2
data/README.md CHANGED
@@ -22,8 +22,14 @@ Main differences with tkn:
22
22
 
23
23
  ## Usage
24
24
 
25
- Have a `.rb` file requiring `tkn2` with a `Tkn2.deck` block. In that block you can use all the available commands.
26
- You'll run that file to start the presentation
25
+ Install tkn2 if you haven't, and run the generator to create a new deck:
26
+
27
+ ```
28
+ $ gem install tkn2
29
+ $ tkn2 new 'My slides'
30
+ ```
31
+
32
+ This will create a directory called `my_slides/` which will contain your deck in the file `my_slides.rb`:
27
33
 
28
34
  ```ruby
29
35
  require 'tkn2'
@@ -33,18 +39,10 @@ Tkn2.deck do
33
39
  end
34
40
  ```
35
41
 
36
- The easiest way to do this is to have a `Gemfile` like this:
37
-
38
- ```ruby
39
- source 'https://rubygems.org'
40
-
41
- gem 'tkn2'
42
- ```
43
-
44
- And then run the presentation using bundler:
42
+ To run the presentation:
45
43
 
46
44
  ```
47
- $ bundle exec ruby mypresentation.rb
45
+ $ bundle exec ruby my_slides.rb
48
46
  ```
49
47
 
50
48
  ### Available commands
@@ -57,7 +55,8 @@ Generates a slide with the given text, centered line by line.
57
55
 
58
56
  ```ruby
59
57
  center <<-EOS
60
- Tkn2 Less is more
58
+ Tkn2
59
+ Less is more
61
60
  EOS
62
61
  ```
63
62
 
@@ -121,7 +120,6 @@ That said:
121
120
  * Better control of *overflow* (currently the presentation crashes if the content doesn't fit in the screen). I'm
122
121
  playing with the idea of having *scroll*, something usually not present in graphical presentation software and that
123
122
  can be useful to present code without using a tiny font size
124
- * A generator
125
123
  * Colors and themes
126
124
  * Plugin system. More as an exercise, I want to try to keep the core small and simple and implement features as plugins
127
125
  * A way to compose slides with more than one element. Tools to generate content (ASCII art diagrams, etc.)
data/bin/tkn2 ADDED
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env ruby
2
+ require 'thor'
3
+ require 'tkn2/version'
4
+
5
+ module Tkn2
6
+ class Cli < Thor
7
+ desc 'new TITLE', 'Generates a new deck named TITLE'
8
+
9
+ def new(title)
10
+ NewDeck.start([title])
11
+ end
12
+ end
13
+
14
+ class NewDeck < Thor::Group
15
+ include Thor::Actions
16
+
17
+ argument :title
18
+
19
+ def self.source_root
20
+ File.join(File.dirname(__FILE__), '..', 'lib', 'tkn2')
21
+ end
22
+
23
+ def create_gemfile
24
+ template 'templates/Gemfile.tt', "#{filename}/Gemfile"
25
+ end
26
+
27
+ def create_deck
28
+ template 'templates/deck.tt', "#{filename}/#{filename}.rb"
29
+ end
30
+
31
+ def create_readme
32
+ template 'templates/readme.tt', "#{filename}/README.md"
33
+ end
34
+
35
+ def install_bundle
36
+ inside filename do
37
+ run 'bundle install'
38
+ end
39
+ end
40
+
41
+ private
42
+
43
+ def version
44
+ Tkn2::VERSION
45
+ end
46
+
47
+ def filename
48
+ @filename ||= Thor::Util.snake_case(title).gsub(/\s+/, '_')
49
+ end
50
+ end
51
+ end
52
+
53
+ Tkn2::Cli.start
@@ -1,3 +1,5 @@
1
+ # originally taken from https://github.com/fxn/tkn/blob/master/examples/constant_autoloading_in_ruby_on_rails.rb
2
+
1
3
  require 'tkn2'
2
4
 
3
5
  Tkn2.deck do
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'tkn2', '<%= version %>'
@@ -0,0 +1,5 @@
1
+ require 'tkn2'
2
+
3
+ Tkn2.deck do
4
+ center '<%= title %>'
5
+ end
@@ -0,0 +1,8 @@
1
+ # <%= title %>
2
+
3
+ Slides made with [Tkn2](https://github.com/porras/tkn2). To watch them, clone the repo, cd into it and run:
4
+
5
+ ```
6
+ $ bundle install # [only the first time]
7
+ $ bundle exec ruby <%= filename %>.rb
8
+ ```
data/lib/tkn2/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tkn2
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
data/tkn2.gemspec CHANGED
@@ -19,6 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "pygments.rb"
22
+ spec.add_dependency "thor"
23
+ spec.add_dependency "bundler"
22
24
 
23
25
  spec.add_development_dependency "bundler", "~> 1.3"
24
26
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkn2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Gil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-30 00:00:00.000000000 Z
11
+ date: 2013-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pygments.rb
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: bundler
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -55,7 +83,8 @@ dependencies:
55
83
  description: tkn2 is a terminal based presentation tool based on fxn's tkn
56
84
  email:
57
85
  - sgilperez@gmail.com
58
- executables: []
86
+ executables:
87
+ - tkn2
59
88
  extensions: []
60
89
  extra_rdoc_files: []
61
90
  files:
@@ -65,6 +94,7 @@ files:
65
94
  - LICENSE.txt
66
95
  - README.md
67
96
  - Rakefile
97
+ - bin/tkn2
68
98
  - examples/constant_autoloading_in_ruby_on_rails.rb
69
99
  - examples/simple.rb
70
100
  - lib/tkn2.rb
@@ -73,6 +103,9 @@ files:
73
103
  - lib/tkn2/deck.rb
74
104
  - lib/tkn2/screen.rb
75
105
  - lib/tkn2/slide.rb
106
+ - lib/tkn2/templates/Gemfile.tt
107
+ - lib/tkn2/templates/deck.tt
108
+ - lib/tkn2/templates/readme.tt
76
109
  - lib/tkn2/utils.rb
77
110
  - lib/tkn2/version.rb
78
111
  - tkn2.gemspec