apache-loggen 0.0.3 → 0.0.4

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.
data/README.md CHANGED
@@ -147,6 +147,7 @@ end
147
147
 
148
148
 
149
149
  # 履歴
150
+ - 0.0.4 Ruby-1.8.7でも動くようにした。
150
151
  - 0.0.3 Rate=1くらいの低速度の場合、Flushが走らないので明示的にFlushするようにした。
151
152
  - 0.0.2 RubyGemsに登録。コマンドを用意した。クラスの再利用ができるようにした。
152
153
  - 0.0.1 はじめてのリリース
@@ -17,4 +17,6 @@ Gem::Specification.new do |gem|
17
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
+
21
+ gem.add_dependency "json"
20
22
  end
@@ -1,5 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
+ require 'rubygems'
3
4
  require 'time'
4
5
  require 'fileutils'
5
6
  require 'optparse'
@@ -92,9 +93,15 @@ module LogGenerator
92
93
  # インナークラスから使うためにmodule化
93
94
  # 使う場合はinclude RANDする
94
95
  module RAND
95
- RANDOM = Random.new
96
- def grand(n)
97
- RANDOM.rand(n)
96
+ if RUBY_VERSION >= '1.9.1'
97
+ RANDOM = Random.new
98
+ def grand(n)
99
+ RANDOM.rand(n)
100
+ end
101
+ else
102
+ def grand(n)
103
+ rand(n)
104
+ end
98
105
  end
99
106
  end
100
107
  include RAND
@@ -171,7 +178,7 @@ module LogGenerator
171
178
  else
172
179
  w = [cate]
173
180
  end
174
- q = w.map {|k| k[0].upcase + k[1..-1] }.join('+')
181
+ q = w.map {|k| k[0..0].upcase + k[1..-1] }.join('+')
175
182
  search_path = "/search/?c=#{q}"
176
183
  google_ref = "http://www.google.com/search?ie=UTF-8&q=google&sclient=psy-ab&q=#{q}&oq=#{q}&aq=f&aqi=g-vL1&aql=&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&biw=#{grand(5000)}&bih=#{grand(600)}"
177
184
 
@@ -1,3 +1,3 @@
1
1
  module LogGenerator
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apache-loggen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,23 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-12-06 00:00:00.000000000 Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: json
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  description: dummy apache-log generator
15
31
  email:
16
32
  - kirscheless@gmail.com