mitten 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -9,50 +9,65 @@ Mitten is A Ruby IRC Bot Pluggable Framework.
9
9
 
10
10
  === RubyGems
11
11
 
12
- 1. rake
12
+ 1. gemcutter
13
+
14
+ $ sudo gem install gemcutter
15
+
16
+ 2. rake
13
17
 
14
18
  $ sudo gem install rake
15
19
 
16
- 2. rspec
20
+ 3. rspec
17
21
 
18
22
  $ sudo gem install rspec
19
23
 
20
- 3. net-irc
24
+ 4. net-irc
21
25
 
22
26
  $ sudo gem install net-irc
23
27
 
24
- 4. daemons
28
+ 5. daemons
25
29
 
26
30
  $ sudo gem install daemons
27
31
 
28
32
 
33
+ == Installation
34
+
35
+ 1. RubyGems
36
+
37
+ $ sudo gem install mitten
38
+
39
+ 2. GitHub
40
+
41
+ $ git clone http://github.com/Tomohiro/mitten.git
42
+
43
+
29
44
  == Usage
30
45
 
31
46
  1. Usage
32
47
 
33
- ./bin/server -h
34
- ./bin/daemon run -- -h
48
+ $ ./bin/server -h
49
+ $ ./bin/daemon run -- -h
35
50
 
36
51
  2. Start
37
52
 
38
- ./bin/daemon start
53
+ $ ./bin/daemon start
39
54
 
40
55
  3. Restart
41
56
 
42
- ./bin/daemon restart
57
+ $ ./bin/daemon restart
43
58
 
44
59
  4. Stop
45
60
 
46
- ./bin/daemon stop
61
+ $ ./bin/daemon stop
47
62
 
48
63
  5. Changed config file
49
64
 
50
- ./bin/daemon start -- -c lib/environment.yaml
65
+ $ ./bin/daemon start -- -c lib/environment.yaml
51
66
 
52
67
  6. Run on the top(not daemonize)
53
68
 
54
- ./bin/server
55
- ./bin/daemon run
69
+ $ ./bin/server
70
+ $ ./bin/daemon run
56
71
 
57
72
 
58
73
  == Rake tasks
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/bin/daemon CHANGED
File without changes
data/bin/server CHANGED
File without changes
data/lib/utils.rb CHANGED
@@ -3,19 +3,18 @@ require 'open-uri'
3
3
  require 'json'
4
4
 
5
5
  module URI
6
- def short(uri)
7
- begin
8
- login = 'tomohiro'
9
- api_key = 'R_9ed4fae410ab7b729a15dc91c8f7687c'
6
+ SHORT_URI_API_LOGIN = ENV['SHORT_URI_API_LOGIN']
7
+ SHORT_URI_API_TOKEN = ENV['SHORT_URI_API_TOKEN']
10
8
 
11
- query = "http://api.j.mp/shorten?version=2.0.1&longUrl=#{uri}&login=#{login}&apiKey=#{api_key}"
9
+ def self.short(uri)
10
+ return uri if SHORT_URI_API_LOGIN == nil
11
+ begin
12
+ query = "http://api.j.mp/shorten?version=2.0.1&longUrl=#{uri.gsub('&', '%26')}&login=#{SHORT_URI_API_LOGIN}&apiKey=#{SHORT_URI_API_TOKEN}"
12
13
  result = JSON.parse(open(query).read)
13
14
 
14
15
  result.first[1].first[1]['shortUrl']
15
- rescue
16
+ rescue Exception => e
16
17
  URI.encode(uri)
17
18
  end
18
19
  end
19
-
20
- module_function :short
21
20
  end
data/mitten.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mitten}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tomohiro, TAIRA"]
@@ -64,8 +64,8 @@ Gem::Specification.new do |s|
64
64
  s.rubygems_version = %q{1.3.5}
65
65
  s.summary = %q{IRC Bot Framework}
66
66
  s.test_files = [
67
- "spec/mitten_spec.rb",
68
- "spec/spec_helper.rb"
67
+ "spec/spec_helper.rb",
68
+ "spec/mitten_spec.rb"
69
69
  ]
70
70
 
71
71
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mitten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomohiro, TAIRA
@@ -101,5 +101,5 @@ signing_key:
101
101
  specification_version: 3
102
102
  summary: IRC Bot Framework
103
103
  test_files:
104
- - spec/mitten_spec.rb
105
104
  - spec/spec_helper.rb
105
+ - spec/mitten_spec.rb