rubberband_flamethrower 0.1.0 → 0.1.1

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/Rakefile CHANGED
@@ -56,6 +56,6 @@ require File.dirname(__FILE__) + "/lib/rubberband_flamethrower"
56
56
  namespace :rubberband_flamethrower do
57
57
  desc "Insert fake data into Elastic Search"
58
58
  task :fire do
59
- RubberbandFlamethrower.start_insert
59
+ RubberbandFlamethrower.send_batch
60
60
  end
61
61
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,28 +1,10 @@
1
1
  module RubberbandFlamethrower
2
- def self.start_insert(how_many=1000, starting_id=1)
2
+ def self.send_batch(how_many=1000, starting_id=1)
3
3
  require "active_support/core_ext"
4
4
  require 'httparty'
5
5
  require File.dirname(__FILE__)+"/rubberband_flamethrower/data_generator.rb"
6
-
7
- # a unique ID must be provided for each document stored in Elastic Search
8
- id = starting_id
9
-
10
- # initialize the random data generator object
11
- data = DataGenerator.new
12
-
13
- how_many.times do |i|
14
-
15
- # generate a piece of random data to insert that approxiamates a tweet
16
- insert_data = data.generate_random_insert_data
17
- puts insert_data
18
-
19
- # insert the random data into local elastic search index "twitter" as type "tweet" with set id
20
- response = HTTParty.put("http://localhost:9200/twitter/tweet/#{id}", body: insert_data)
21
- puts response.body
22
-
23
- #increment the insert id
24
- id = id + 1
25
- end
26
- puts "Finished Inserting #{how_many} documents into Elastic Search."
6
+ require File.dirname(__FILE__)+"/rubberband_flamethrower/flamethrower.rb"
7
+ flamethrower = Flamethrower.new
8
+ flamethrower.send_batch(how_many, starting_id)
27
9
  end
28
10
  end
@@ -0,0 +1,29 @@
1
+ # This class is designed to insert objects created with the DataGenerator class into Elastic Search
2
+ module RubberbandFlamethrower
3
+ class Flamethrower
4
+
5
+ def send_batch(how_many, starting_id)
6
+ # a unique ID must be provided for each document stored in Elastic Search
7
+ id = starting_id
8
+
9
+ # initialize the random data generator object
10
+ data = DataGenerator.new
11
+
12
+ how_many.times do |i|
13
+
14
+ # generate a piece of random data to insert that approxiamates a tweet
15
+ insert_data = data.generate_random_insert_data
16
+ puts insert_data
17
+
18
+ # insert the random data into local elastic search index "twitter" as type "tweet" with set id
19
+ response = HTTParty.put("http://localhost:9200/twitter/tweet/#{id}", body: insert_data)
20
+ puts response.body
21
+
22
+ #increment the insert id
23
+ id = id + 1
24
+ end
25
+ puts "Finished Inserting #{how_many} documents into Elastic Search."
26
+ end
27
+
28
+ end
29
+ end
@@ -0,0 +1,76 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "rubberband_flamethrower"
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Michael Orr"]
12
+ s.date = "2013-04-03"
13
+ s.description = "Use to quickly fill up some indicies in Elastic Search and to retrieve statistics about insertion rates"
14
+ s.email = "michael@cloudspace.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "lib/rubberband_flamethrower.rb",
28
+ "lib/rubberband_flamethrower/.DS_Store",
29
+ "lib/rubberband_flamethrower/data_generator.rb",
30
+ "lib/rubberband_flamethrower/flamethrower.rb",
31
+ "lib/rubberband_flamethrower/inserter.rb",
32
+ "lib/rubberband_flamethrower/retriever.rb",
33
+ "lib/rubberband_flamethrower/words/README",
34
+ "lib/rubberband_flamethrower/words/american-words.10",
35
+ "lib/rubberband_flamethrower/words/american-words.20",
36
+ "lib/rubberband_flamethrower/words/american-words.35",
37
+ "lib/rubberband_flamethrower/words/american-words.40",
38
+ "lib/rubberband_flamethrower/words/american-words.50",
39
+ "lib/rubberband_flamethrower/words/american-words.55",
40
+ "lib/rubberband_flamethrower/words/american-words.60",
41
+ "lib/rubberband_flamethrower/words/american-words.70",
42
+ "lib/rubberband_flamethrower/words/american-words.80",
43
+ "lib/rubberband_flamethrower/words/american-words.95",
44
+ "rubberband_flamethrower.gemspec"
45
+ ]
46
+ s.homepage = "http://github.com/imightbeinatree/rubberband_flamethrower"
47
+ s.licenses = ["MIT"]
48
+ s.require_paths = ["lib"]
49
+ s.rubygems_version = "1.8.11"
50
+ s.summary = "Rapidly Insert Fake Data into Elastic Search"
51
+
52
+ if s.respond_to? :specification_version then
53
+ s.specification_version = 3
54
+
55
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
56
+ s.add_runtime_dependency(%q<httparty>, ["~> 0.10.2"])
57
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.2.13"])
58
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
59
+ s.add_development_dependency(%q<bundler>, ["~> 1.3.0"])
60
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
61
+ else
62
+ s.add_dependency(%q<httparty>, ["~> 0.10.2"])
63
+ s.add_dependency(%q<activesupport>, ["~> 3.2.13"])
64
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
65
+ s.add_dependency(%q<bundler>, ["~> 1.3.0"])
66
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
67
+ end
68
+ else
69
+ s.add_dependency(%q<httparty>, ["~> 0.10.2"])
70
+ s.add_dependency(%q<activesupport>, ["~> 3.2.13"])
71
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
72
+ s.add_dependency(%q<bundler>, ["~> 1.3.0"])
73
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
74
+ end
75
+ end
76
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubberband_flamethrower
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &26188920 !ruby/object:Gem::Requirement
16
+ requirement: &22154720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.10.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *26188920
24
+ version_requirements: *22154720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &26188420 !ruby/object:Gem::Requirement
27
+ requirement: &22154220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.2.13
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *26188420
35
+ version_requirements: *22154220
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &26187920 !ruby/object:Gem::Requirement
38
+ requirement: &22153720 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3.12'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *26187920
46
+ version_requirements: *22153720
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &26187400 !ruby/object:Gem::Requirement
49
+ requirement: &22153240 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.3.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *26187400
57
+ version_requirements: *22153240
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &26186860 !ruby/object:Gem::Requirement
60
+ requirement: &22152740 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 1.8.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *26186860
68
+ version_requirements: *22152740
69
69
  description: Use to quickly fill up some indicies in Elastic Search and to retrieve
70
70
  statistics about insertion rates
71
71
  email: michael@cloudspace.com
@@ -85,6 +85,7 @@ files:
85
85
  - lib/rubberband_flamethrower.rb
86
86
  - lib/rubberband_flamethrower/.DS_Store
87
87
  - lib/rubberband_flamethrower/data_generator.rb
88
+ - lib/rubberband_flamethrower/flamethrower.rb
88
89
  - lib/rubberband_flamethrower/inserter.rb
89
90
  - lib/rubberband_flamethrower/retriever.rb
90
91
  - lib/rubberband_flamethrower/words/README
@@ -98,6 +99,7 @@ files:
98
99
  - lib/rubberband_flamethrower/words/american-words.70
99
100
  - lib/rubberband_flamethrower/words/american-words.80
100
101
  - lib/rubberband_flamethrower/words/american-words.95
102
+ - rubberband_flamethrower.gemspec
101
103
  homepage: http://github.com/imightbeinatree/rubberband_flamethrower
102
104
  licenses:
103
105
  - MIT
@@ -113,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
115
  version: '0'
114
116
  segments:
115
117
  - 0
116
- hash: 3907985939614258525
118
+ hash: 3263408278547135981
117
119
  required_rubygems_version: !ruby/object:Gem::Requirement
118
120
  none: false
119
121
  requirements: