supple 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7b0bc65b51b059b992af16aa9599c7020812d1d1
4
+ data.tar.gz: 1dad7d908693f00bd824816e57f3d51e0f36fd83
5
+ SHA512:
6
+ metadata.gz: 7767aea0996fb70ccf69be1d0567236935a6a403a74018f47c29957003d1f8f27cf0c7152a009a5859269e5614191dff00b37987007f8c52b43db70590ace3dc
7
+ data.tar.gz: 06dc1dba727a8691ff3c0d8e67c1ff4f80568856cd63874aac2c013047b73cccf8d35bda059c0036e4efa4946bc0c9a69e2dd2ec68d423c2008aaef9cf6171e7
@@ -0,0 +1,3 @@
1
+ -
2
+ ChangeLog.md
3
+ LICENSE.txt
@@ -0,0 +1,7 @@
1
+ Gemfile.lock
2
+ doc/
3
+ pkg/
4
+ vendor/cache/*.gem
5
+ .bundle/
6
+ .DS_Store
7
+ *.sublime-workspace
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
@@ -0,0 +1,18 @@
1
+ Documentation:
2
+ Enabled: false
3
+
4
+ RedundantSelf:
5
+ Enabled: false
6
+
7
+ LineLength:
8
+ Max: 200
9
+
10
+ HashSyntax:
11
+ EnforcedStyle: ruby19
12
+
13
+ AllCops:
14
+ Includes:
15
+ - Gemfile
16
+ - Rakefile
17
+ Excludes:
18
+ - bin/**
@@ -0,0 +1 @@
1
+ supple
@@ -0,0 +1 @@
1
+ 2.0.0
@@ -0,0 +1 @@
1
+ --markup markdown --title "supple Documentation" --protected
@@ -0,0 +1,11 @@
1
+ appraise "rails-4.0" do
2
+ gem "rails", "4.0"
3
+ end
4
+
5
+ appraise "rails-4.1" do
6
+ gem "rails", "4.1.0.rc1"
7
+ end
8
+
9
+ appraise "rails-3" do
10
+ gem "rails", "3.2"
11
+ end
@@ -0,0 +1,4 @@
1
+ ### 0.1.0 / 2014-02-26
2
+
3
+ * Initial release:
4
+
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+ gem 'rails', '4.1.0.rc1'
5
+
6
+ group :development do
7
+ gem 'kramdown'
8
+ gem 'pry'
9
+ gem 'guard'
10
+ gem 'guard-rspec'
11
+ gem 'guard-rubocop'
12
+ gem 'gem-release'
13
+ end
@@ -0,0 +1,10 @@
1
+ guard :rspec do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch('spec/spec_helper.rb') { "spec" }
4
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
5
+ end
6
+
7
+ # guard :rubocop, all_on_start: true, cli: ['--auto-correct'] do
8
+ # watch(%r{.+\.rb$})
9
+ # watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
10
+ # end
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 George Erickson
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,11 @@
1
+ # Supple
2
+ Rails elasticsearch integration with no magic.
3
+
4
+ ## Setup
5
+ ```ruby
6
+ Supple.configure do |config|
7
+ config.pool_size = 5
8
+ config.pool_timeout = 1
9
+ config.index_name = -> { table_name }
10
+ end
11
+ ```
@@ -0,0 +1,15 @@
1
+ require 'rubygems'
2
+ require 'appraisal'
3
+ require 'rake'
4
+
5
+
6
+ require 'rubygems/tasks'
7
+ Gem::Tasks.new
8
+
9
+ require 'rspec/core/rake_task'
10
+ RSpec::Core::RakeTask.new
11
+
12
+ require 'elasticsearch/extensions/test/cluster/tasks'
13
+
14
+ task test: :spec
15
+ task default: :spec
@@ -0,0 +1,33 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'benchmark'
4
+ require 'supple'
5
+
6
+ def measure(adapter)
7
+ client = Elasticsearch::Client.new(adapter: adapter)
8
+ Benchmark.realtime do
9
+ 100.times do
10
+ client.nodes.stats(metric: 'http')['nodes'].values.each do |n|
11
+ "#{n['name']} : #{n['http']['total_opened']}"
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ puts measure(:patron)
18
+ puts measure(:net_http)
19
+
20
+ def measure2(adapter)
21
+ Supple.es do |client|
22
+ Benchmark.realtime do
23
+ 100.times do
24
+ client.nodes.stats(metric: 'http')['nodes'].values.each do |n|
25
+ "#{n['name']} : #{n['http']['total_opened']}"
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+
32
+ puts measure2(:patron)
33
+ puts measure2(:net_http)
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'guard' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('guard', 'guard')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rubocop' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rubocop', 'rubocop')
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "3.2"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,144 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ supple (0.1.0)
5
+ ansi
6
+ bonfig
7
+ connection_pool
8
+ elasticsearch
9
+ patron
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actionmailer (3.2.0)
15
+ actionpack (= 3.2.0)
16
+ mail (~> 2.4.0)
17
+ actionpack (3.2.0)
18
+ activemodel (= 3.2.0)
19
+ activesupport (= 3.2.0)
20
+ builder (~> 3.0.0)
21
+ erubis (~> 2.7.0)
22
+ journey (~> 1.0.0)
23
+ rack (~> 1.4.0)
24
+ rack-cache (~> 1.1)
25
+ rack-test (~> 0.6.1)
26
+ sprockets (~> 2.1.2)
27
+ activemodel (3.2.0)
28
+ activesupport (= 3.2.0)
29
+ builder (~> 3.0.0)
30
+ activerecord (3.2.0)
31
+ activemodel (= 3.2.0)
32
+ activesupport (= 3.2.0)
33
+ arel (~> 3.0.0)
34
+ tzinfo (~> 0.3.29)
35
+ activeresource (3.2.0)
36
+ activemodel (= 3.2.0)
37
+ activesupport (= 3.2.0)
38
+ activesupport (3.2.0)
39
+ i18n (~> 0.6)
40
+ multi_json (~> 1.0)
41
+ ansi (1.4.3)
42
+ appraisal (0.5.2)
43
+ bundler
44
+ rake
45
+ arel (3.0.3)
46
+ bonfig (0.1.1)
47
+ builder (3.0.4)
48
+ coderay (1.1.0)
49
+ connection_pool (1.2.0)
50
+ diff-lcs (1.2.5)
51
+ elasticsearch (1.0.1)
52
+ elasticsearch-api (= 1.0.1)
53
+ elasticsearch-transport (= 1.0.1)
54
+ elasticsearch-api (1.0.1)
55
+ multi_json
56
+ elasticsearch-transport (1.0.1)
57
+ faraday
58
+ multi_json
59
+ erubis (2.7.0)
60
+ factory_girl (4.4.0)
61
+ activesupport (>= 3.0.0)
62
+ faraday (0.9.0)
63
+ multipart-post (>= 1.2, < 3)
64
+ hike (1.2.3)
65
+ i18n (0.6.9)
66
+ journey (1.0.4)
67
+ json (1.8.1)
68
+ mail (2.4.4)
69
+ i18n (>= 0.4.0)
70
+ mime-types (~> 1.16)
71
+ treetop (~> 1.4.8)
72
+ method_source (0.8.2)
73
+ mime-types (1.25.1)
74
+ multi_json (1.9.0)
75
+ multipart-post (2.0.0)
76
+ patron (0.4.18)
77
+ polyglot (0.3.4)
78
+ pry (0.9.12.6)
79
+ coderay (~> 1.0)
80
+ method_source (~> 0.8)
81
+ slop (~> 3.4)
82
+ rack (1.4.5)
83
+ rack-cache (1.2)
84
+ rack (>= 0.4)
85
+ rack-ssl (1.3.3)
86
+ rack
87
+ rack-test (0.6.2)
88
+ rack (>= 1.0)
89
+ rails (3.2.0)
90
+ actionmailer (= 3.2.0)
91
+ actionpack (= 3.2.0)
92
+ activerecord (= 3.2.0)
93
+ activeresource (= 3.2.0)
94
+ activesupport (= 3.2.0)
95
+ bundler (~> 1.0)
96
+ railties (= 3.2.0)
97
+ railties (3.2.0)
98
+ actionpack (= 3.2.0)
99
+ activesupport (= 3.2.0)
100
+ rack-ssl (~> 1.3.2)
101
+ rake (>= 0.8.7)
102
+ rdoc (~> 3.4)
103
+ thor (~> 0.14.6)
104
+ rake (10.1.1)
105
+ rdoc (3.12.2)
106
+ json (~> 1.4)
107
+ rspec (2.14.1)
108
+ rspec-core (~> 2.14.0)
109
+ rspec-expectations (~> 2.14.0)
110
+ rspec-mocks (~> 2.14.0)
111
+ rspec-core (2.14.8)
112
+ rspec-expectations (2.14.5)
113
+ diff-lcs (>= 1.1.3, < 2.0)
114
+ rspec-mocks (2.14.6)
115
+ rubygems-tasks (0.2.4)
116
+ slop (3.4.7)
117
+ sprockets (2.1.3)
118
+ hike (~> 1.2)
119
+ rack (~> 1.0)
120
+ tilt (~> 1.1, != 1.3.0)
121
+ sqlite3 (1.3.9)
122
+ thor (0.14.6)
123
+ tilt (1.4.1)
124
+ treetop (1.4.15)
125
+ polyglot
126
+ polyglot (>= 0.3.1)
127
+ tzinfo (0.3.38)
128
+ yard (0.8.7.3)
129
+
130
+ PLATFORMS
131
+ ruby
132
+
133
+ DEPENDENCIES
134
+ appraisal
135
+ bundler
136
+ factory_girl
137
+ pry
138
+ rails (= 3.2)
139
+ rake
140
+ rspec
141
+ rubygems-tasks
142
+ sqlite3
143
+ supple!
144
+ yard
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "4.1.0.rc1"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,139 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ supple (0.1.0)
5
+ ansi
6
+ bonfig
7
+ connection_pool
8
+ elasticsearch
9
+ patron
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actionmailer (4.0.0)
15
+ actionpack (= 4.0.0)
16
+ mail (~> 2.5.3)
17
+ actionpack (4.0.0)
18
+ activesupport (= 4.0.0)
19
+ builder (~> 3.1.0)
20
+ erubis (~> 2.7.0)
21
+ rack (~> 1.5.2)
22
+ rack-test (~> 0.6.2)
23
+ activemodel (4.0.0)
24
+ activesupport (= 4.0.0)
25
+ builder (~> 3.1.0)
26
+ activerecord (4.0.0)
27
+ activemodel (= 4.0.0)
28
+ activerecord-deprecated_finders (~> 1.0.2)
29
+ activesupport (= 4.0.0)
30
+ arel (~> 4.0.0)
31
+ activerecord-deprecated_finders (1.0.3)
32
+ activesupport (4.0.0)
33
+ i18n (~> 0.6, >= 0.6.4)
34
+ minitest (~> 4.2)
35
+ multi_json (~> 1.3)
36
+ thread_safe (~> 0.1)
37
+ tzinfo (~> 0.3.37)
38
+ ansi (1.4.3)
39
+ appraisal (0.5.2)
40
+ bundler
41
+ rake
42
+ arel (4.0.2)
43
+ atomic (1.1.15)
44
+ bonfig (0.1.1)
45
+ builder (3.1.4)
46
+ coderay (1.1.0)
47
+ connection_pool (1.2.0)
48
+ diff-lcs (1.2.5)
49
+ elasticsearch (1.0.1)
50
+ elasticsearch-api (= 1.0.1)
51
+ elasticsearch-transport (= 1.0.1)
52
+ elasticsearch-api (1.0.1)
53
+ multi_json
54
+ elasticsearch-transport (1.0.1)
55
+ faraday
56
+ multi_json
57
+ erubis (2.7.0)
58
+ factory_girl (4.4.0)
59
+ activesupport (>= 3.0.0)
60
+ faraday (0.9.0)
61
+ multipart-post (>= 1.2, < 3)
62
+ hike (1.2.3)
63
+ i18n (0.6.9)
64
+ mail (2.5.4)
65
+ mime-types (~> 1.16)
66
+ treetop (~> 1.4.8)
67
+ method_source (0.8.2)
68
+ mime-types (1.25.1)
69
+ minitest (4.7.5)
70
+ multi_json (1.9.0)
71
+ multipart-post (2.0.0)
72
+ patron (0.4.18)
73
+ polyglot (0.3.4)
74
+ pry (0.9.12.6)
75
+ coderay (~> 1.0)
76
+ method_source (~> 0.8)
77
+ slop (~> 3.4)
78
+ rack (1.5.2)
79
+ rack-test (0.6.2)
80
+ rack (>= 1.0)
81
+ rails (4.0.0)
82
+ actionmailer (= 4.0.0)
83
+ actionpack (= 4.0.0)
84
+ activerecord (= 4.0.0)
85
+ activesupport (= 4.0.0)
86
+ bundler (>= 1.3.0, < 2.0)
87
+ railties (= 4.0.0)
88
+ sprockets-rails (~> 2.0.0)
89
+ railties (4.0.0)
90
+ actionpack (= 4.0.0)
91
+ activesupport (= 4.0.0)
92
+ rake (>= 0.8.7)
93
+ thor (>= 0.18.1, < 2.0)
94
+ rake (0.9.6)
95
+ rspec (2.14.1)
96
+ rspec-core (~> 2.14.0)
97
+ rspec-expectations (~> 2.14.0)
98
+ rspec-mocks (~> 2.14.0)
99
+ rspec-core (2.14.8)
100
+ rspec-expectations (2.14.5)
101
+ diff-lcs (>= 1.1.3, < 2.0)
102
+ rspec-mocks (2.14.6)
103
+ rubygems-tasks (0.2.4)
104
+ slop (3.4.7)
105
+ sprockets (2.11.0)
106
+ hike (~> 1.2)
107
+ multi_json (~> 1.0)
108
+ rack (~> 1.0)
109
+ tilt (~> 1.1, != 1.3.0)
110
+ sprockets-rails (2.0.1)
111
+ actionpack (>= 3.0)
112
+ activesupport (>= 3.0)
113
+ sprockets (~> 2.8)
114
+ sqlite3 (1.3.9)
115
+ thor (0.18.1)
116
+ thread_safe (0.2.0)
117
+ atomic (>= 1.1.7, < 2)
118
+ tilt (1.4.1)
119
+ treetop (1.4.15)
120
+ polyglot
121
+ polyglot (>= 0.3.1)
122
+ tzinfo (0.3.38)
123
+ yard (0.8.7.3)
124
+
125
+ PLATFORMS
126
+ ruby
127
+
128
+ DEPENDENCIES
129
+ appraisal
130
+ bundler
131
+ factory_girl
132
+ pry
133
+ rails (= 4.0)
134
+ rake
135
+ rspec
136
+ rubygems-tasks
137
+ sqlite3
138
+ supple!
139
+ yard