tinatra 0.1.0 → 0.2.0

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.
Files changed (5) hide show
  1. data/README.mkd +12 -0
  2. data/VERSION +1 -1
  3. data/lib/tinatra.rb +9 -0
  4. data/tinatra.gemspec +2 -2
  5. metadata +3 -3
data/README.mkd CHANGED
@@ -13,6 +13,8 @@ Tinatra is a DSL for making twitter bots. It's like Sinatra. トゥィナトラ.
13
13
 
14
14
  gem install tinatra
15
15
 
16
+ <http://rubygems.org/gems/tinatra>
17
+
16
18
  ## Usage
17
19
 
18
20
  require 'tinatra'
@@ -39,6 +41,8 @@ Tinatra is a DSL for making twitter bots. It's like Sinatra. トゥィナトラ.
39
41
 
40
42
  always do
41
43
  # Always run
44
+ p api.class #=> OAuthRubytter
45
+ api.update("hi")
42
46
  end
43
47
 
44
48
  ### Setup
@@ -54,6 +58,14 @@ Tinatra is a DSL for making twitter bots. It's like Sinatra. トゥィナトラ.
54
58
  Authorizing is done.
55
59
  $ ruby a.rb --db=/path/to/db
56
60
 
61
+ ### Database
62
+
63
+ $ ruby a.rb --db=...
64
+
65
+ db "..."
66
+
67
+ set :db, "..."
68
+
57
69
  ## License
58
70
 
59
71
  The MIT Licence
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -188,6 +188,11 @@ Usage: #{File.basename($0)} [--db=DATABASE] [--init|--help]
188
188
  @t
189
189
  end
190
190
 
191
+ def db
192
+ init_db unless @db
193
+ @db
194
+ end
195
+
191
196
  [:mention,:timeline,:direct_message,:always,:followed,:removed].each do |act|
192
197
  eval "def #{act}(&block); add_action(:#{act},block); end"
193
198
  end
@@ -259,6 +264,10 @@ module Kernel
259
264
  def api
260
265
  Tinatra.instance.api
261
266
  end
267
+
268
+ def db
269
+ Tinatra.instance.db
270
+ end
262
271
  end
263
272
 
264
273
  at_exit do
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tinatra}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Shota Fukumori (sora_h)"]
12
- s.date = %q{2010-09-14}
12
+ s.date = %q{2010-09-20}
13
13
  s.description = %q{Ruby implemented DSL, designed for twitter bot.}
14
14
  s.email = %q{sora134@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
7
+ - 2
8
8
  - 0
9
- version: 0.1.0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Shota Fukumori (sora_h)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-14 00:00:00 +09:00
17
+ date: 2010-09-20 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency