active-record-streamer 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0109c5a9442a68bb7f3e62685d8d415b126edb9f
4
- data.tar.gz: 14db767e20d9e3eeaaed277a7e5c60728d5b63e4
3
+ metadata.gz: 7c90f012beb1b6c5b8768a09956c7c1c06ff5dd8
4
+ data.tar.gz: 634efb3f40e541960d95f2c3f2e668471a88047f
5
5
  SHA512:
6
- metadata.gz: 7b1603127f1b1100efd4114c1954ebddfb6f96afc63b49a00ca434de2f57d7b87b88280dd3d391a13a29c620bbfb63ef563de55b7f2268f7523a3129ee329f6b
7
- data.tar.gz: cd3a12cc4776eb0f36e231fd842365cbab1ca83e66dc4f1ebc2667b86081c4d8057ec953741dd9df69bc9e6c072a88d66f5692242a8148bcac208a6cc3e2f496
6
+ metadata.gz: b68c8cfbee359eecc12ee0ad64e9a4537d2bcc6209d2111fbc84e3195286183bc41e44fc0f73d952b3da0cc9c35cddbef252f5c89666bea4d0d538eae0e2e142
7
+ data.tar.gz: 0f1306b5387ba0cca65a5341c90ac362382d08ff6673a8bc63aa7636e380c47a62197be8c6c44105137c530287eca5253362ca96e2c58b973fa9f46edfb5c46f
@@ -0,0 +1,61 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ DisplayStyleGuide: true
4
+ Exclude:
5
+ - db/schema.rb
6
+ - spec/dummy/db/schema.rb
7
+ - active-record-streamer.gemspec
8
+
9
+ # https://github.com/AtomLinter/linter-rubocop/issues/2
10
+ Style/FileName:
11
+ Enabled: false
12
+
13
+ Metrics/LineLength:
14
+ Max: 160
15
+
16
+ Metrics/MethodLength:
17
+ Max: 50
18
+
19
+ Metrics/AbcSize:
20
+ Max: 25
21
+
22
+ Metrics/ClassLength:
23
+ Max: 250
24
+
25
+ Style/AccessModifierIndentation:
26
+ EnforcedStyle: outdent
27
+
28
+ Style/ClassAndModuleChildren:
29
+ EnforcedStyle: compact
30
+
31
+ Style/Documentation:
32
+ Enabled: false
33
+
34
+ Style/EmptyLines:
35
+ Enabled: false
36
+
37
+ Style/StringLiterals:
38
+ EnforcedStyle: double_quotes
39
+
40
+ Style/StringLiteralsInInterpolation:
41
+ Enabled: false
42
+
43
+ Style/NilComparison:
44
+ Enabled: false
45
+
46
+ Style/SignalException:
47
+ EnforcedStyle: only_raise
48
+
49
+ Style/MultilineOperationIndentation:
50
+ EnforcedStyle: indented
51
+
52
+ Style/SpaceInsideHashLiteralBraces:
53
+ EnforcedStyle: no_space
54
+
55
+ Style/TrivialAccessors:
56
+ ExactNameMatch: true
57
+ Enabled: true
58
+
59
+ # Disabled on purpose: https://github.com/bbatsov/rubocop/issues/1758
60
+ Style/ClosingParenthesisIndentation:
61
+ Enabled: false
@@ -0,0 +1,12 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-01-07 22:24:54 +0100 using RuboCop version 0.35.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ Style/ClassVars:
11
+ Exclude:
12
+ - 'lib/active-record-streamer.rb'
data/Gemfile CHANGED
@@ -3,18 +3,21 @@ source "http://rubygems.org"
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
 
6
- gem 'baza', '>= 0.0.19'
6
+ gem "baza", ">= 0.0.20"
7
7
 
8
8
  # Add dependencies to develop your gem here.
9
9
  # Include everything needed to run rake, tests, features, etc.
10
10
  group :development do
11
- gem 'activerecord', '4.2.1'
12
- gem 'mysql2', '0.3.18'
13
- gem 'pry'
11
+ gem "activerecord", "4.2.1"
12
+ gem "mysql2", "0.3.18"
13
+ gem "pry"
14
14
 
15
- gem 'rspec', '~> 2.8.0'
16
- gem 'rdoc', '~> 3.12'
17
- gem 'bundler', '~> 1.0'
18
- gem 'jeweler', '~> 2.0.1'
19
- gem 'simplecov', '>= 0'
15
+ gem "rspec", "~> 2.8.0"
16
+ gem "rdoc", "~> 3.12"
17
+ gem "bundler", "~> 1.0"
18
+ gem "jeweler", "~> 2.0.1"
19
+ gem "simplecov", ">= 0"
20
+
21
+ gem "best_practice_project"
22
+ gem "rubocop"
20
23
  end
@@ -17,12 +17,19 @@ GEM
17
17
  addressable (2.3.8)
18
18
  arel (6.0.0)
19
19
  array_enumerator (0.0.10)
20
- baza (0.0.19)
20
+ ast (2.2.0)
21
+ astrolabe (1.3.1)
22
+ parser (~> 2.2)
23
+ auto_autoloader (0.0.1)
24
+ string-cases
25
+ baza (0.0.20)
21
26
  array_enumerator (~> 0.0.10)
22
27
  datet (~> 0.0.25)
23
28
  event_handler (~> 0.0.0)
24
29
  string-cases (~> 0.0.1)
25
30
  wref (~> 0.0.8)
31
+ best_practice_project (0.0.8)
32
+ auto_autoloader
26
33
  builder (3.2.2)
27
34
  coderay (1.1.0)
28
35
  datet (0.0.25)
@@ -71,11 +78,15 @@ GEM
71
78
  multi_json (~> 1.3)
72
79
  multi_xml (~> 0.5)
73
80
  rack (~> 1.2)
81
+ parser (2.2.3.0)
82
+ ast (>= 1.1, < 3.0)
83
+ powerpack (0.1.1)
74
84
  pry (0.10.1)
75
85
  coderay (~> 1.1.0)
76
86
  method_source (~> 0.8.1)
77
87
  slop (~> 3.4)
78
88
  rack (1.6.1)
89
+ rainbow (2.0.0)
79
90
  rake (10.4.2)
80
91
  rdoc (3.12.2)
81
92
  json (~> 1.4)
@@ -87,14 +98,23 @@ GEM
87
98
  rspec-expectations (2.8.0)
88
99
  diff-lcs (~> 1.1.2)
89
100
  rspec-mocks (2.8.0)
101
+ rubocop (0.35.1)
102
+ astrolabe (~> 1.3)
103
+ parser (>= 2.2.3.0, < 3.0)
104
+ powerpack (~> 0.1)
105
+ rainbow (>= 1.99.1, < 3.0)
106
+ ruby-progressbar (~> 1.7)
107
+ tins (<= 1.6.0)
108
+ ruby-progressbar (1.7.5)
90
109
  simplecov (0.10.0)
91
110
  docile (~> 1.1.0)
92
111
  json (~> 1.8)
93
112
  simplecov-html (~> 0.10.0)
94
113
  simplecov-html (0.10.0)
95
114
  slop (3.6.0)
96
- string-cases (0.0.1)
115
+ string-cases (0.0.3)
97
116
  thread_safe (0.3.5)
117
+ tins (1.6.0)
98
118
  tzinfo (1.2.2)
99
119
  thread_safe (~> 0.1)
100
120
  wref (0.0.8)
@@ -104,14 +124,16 @@ PLATFORMS
104
124
 
105
125
  DEPENDENCIES
106
126
  activerecord (= 4.2.1)
107
- baza (>= 0.0.19)
127
+ baza (>= 0.0.20)
128
+ best_practice_project
108
129
  bundler (~> 1.0)
109
130
  jeweler (~> 2.0.1)
110
131
  mysql2 (= 0.3.18)
111
132
  pry
112
133
  rdoc (~> 3.12)
113
134
  rspec (~> 2.8.0)
135
+ rubocop
114
136
  simplecov
115
137
 
116
138
  BUNDLED WITH
117
- 1.10.5
139
+ 1.11.2
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'rubygems'
4
- require 'bundler'
3
+ require "rubygems"
4
+ require "bundler"
5
5
  begin
6
6
  Bundler.setup(:default, :development)
7
7
  rescue Bundler::BundlerError => e
@@ -9,42 +9,45 @@ rescue Bundler::BundlerError => e
9
9
  $stderr.puts "Run `bundle install` to install missing gems"
10
10
  exit e.status_code
11
11
  end
12
- require 'rake'
12
+ require "rake"
13
13
 
14
- require 'jeweler'
14
+ require "jeweler"
15
15
  Jeweler::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
17
  gem.name = "active-record-streamer"
18
18
  gem.homepage = "http://github.com/kaspernj/active-record-streamer"
19
19
  gem.license = "MIT"
20
- gem.summary = %Q{Stream ActiveRecord results}
21
- gem.description = %Q{Stream ActiveRecord results}
20
+ gem.summary = %(Stream ActiveRecord results)
21
+ gem.description = %(Stream ActiveRecord results)
22
22
  gem.email = "k@spernj.org"
23
23
  gem.authors = ["kaspernj"]
24
24
  # dependencies defined in Gemfile
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
27
27
 
28
- require 'rspec/core'
29
- require 'rspec/core/rake_task'
28
+ require "rspec/core"
29
+ require "rspec/core/rake_task"
30
30
  RSpec::Core::RakeTask.new(:spec) do |spec|
31
- spec.pattern = FileList['spec/**/*_spec.rb']
31
+ spec.pattern = FileList["spec/**/*_spec.rb"]
32
32
  end
33
33
 
34
34
  desc "Code coverage detail"
35
35
  task :simplecov do
36
- ENV['COVERAGE'] = "true"
37
- Rake::Task['spec'].execute
36
+ ENV["COVERAGE"] = "true"
37
+ Rake::Task["spec"].execute
38
38
  end
39
39
 
40
- task :default => :spec
40
+ task default: :spec
41
41
 
42
- require 'rdoc/task'
42
+ require "rdoc/task"
43
43
  Rake::RDocTask.new do |rdoc|
44
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
+ version = File.exist?("VERSION") ? File.read("VERSION") : ""
45
45
 
46
- rdoc.rdoc_dir = 'rdoc'
46
+ rdoc.rdoc_dir = "rdoc"
47
47
  rdoc.title = "active-record-streamer #{version}"
48
- rdoc.rdoc_files.include('README*')
49
- rdoc.rdoc_files.include('lib/**/*.rb')
48
+ rdoc.rdoc_files.include("README*")
49
+ rdoc.rdoc_files.include("lib/**/*.rb")
50
50
  end
51
+
52
+ require "best_practice_project"
53
+ BestPracticeProject.load_tasks
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: active-record-streamer 0.0.2 ruby lib
5
+ # stub: active-record-streamer 0.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "active-record-streamer"
9
- s.version = "0.0.2"
9
+ s.version = "0.0.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["kaspernj"]
14
- s.date = "2015-08-05"
14
+ s.date = "2016-01-07"
15
15
  s.description = "Stream ActiveRecord results"
16
16
  s.email = "k@spernj.org"
17
17
  s.extra_rdoc_files = [
@@ -21,6 +21,8 @@ Gem::Specification.new do |s|
21
21
  s.files = [
22
22
  ".document",
23
23
  ".rspec",
24
+ ".rubocop.yml",
25
+ ".rubocop_todo.yml",
24
26
  "Gemfile",
25
27
  "Gemfile.lock",
26
28
  "LICENSE.txt",
@@ -41,7 +43,7 @@ Gem::Specification.new do |s|
41
43
  s.specification_version = 4
42
44
 
43
45
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
- s.add_runtime_dependency(%q<baza>, [">= 0.0.19"])
46
+ s.add_runtime_dependency(%q<baza>, [">= 0.0.20"])
45
47
  s.add_development_dependency(%q<activerecord>, ["= 4.2.1"])
46
48
  s.add_development_dependency(%q<mysql2>, ["= 0.3.18"])
47
49
  s.add_development_dependency(%q<pry>, [">= 0"])
@@ -50,8 +52,10 @@ Gem::Specification.new do |s|
50
52
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
51
53
  s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
52
54
  s.add_development_dependency(%q<simplecov>, [">= 0"])
55
+ s.add_development_dependency(%q<best_practice_project>, [">= 0"])
56
+ s.add_development_dependency(%q<rubocop>, [">= 0"])
53
57
  else
54
- s.add_dependency(%q<baza>, [">= 0.0.19"])
58
+ s.add_dependency(%q<baza>, [">= 0.0.20"])
55
59
  s.add_dependency(%q<activerecord>, ["= 4.2.1"])
56
60
  s.add_dependency(%q<mysql2>, ["= 0.3.18"])
57
61
  s.add_dependency(%q<pry>, [">= 0"])
@@ -60,9 +64,11 @@ Gem::Specification.new do |s|
60
64
  s.add_dependency(%q<bundler>, ["~> 1.0"])
61
65
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
62
66
  s.add_dependency(%q<simplecov>, [">= 0"])
67
+ s.add_dependency(%q<best_practice_project>, [">= 0"])
68
+ s.add_dependency(%q<rubocop>, [">= 0"])
63
69
  end
64
70
  else
65
- s.add_dependency(%q<baza>, [">= 0.0.19"])
71
+ s.add_dependency(%q<baza>, [">= 0.0.20"])
66
72
  s.add_dependency(%q<activerecord>, ["= 4.2.1"])
67
73
  s.add_dependency(%q<mysql2>, ["= 0.3.18"])
68
74
  s.add_dependency(%q<pry>, [">= 0"])
@@ -71,6 +77,8 @@ Gem::Specification.new do |s|
71
77
  s.add_dependency(%q<bundler>, ["~> 1.0"])
72
78
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
73
79
  s.add_dependency(%q<simplecov>, [">= 0"])
80
+ s.add_dependency(%q<best_practice_project>, [">= 0"])
81
+ s.add_dependency(%q<rubocop>, [">= 0"])
74
82
  end
75
83
  end
76
84
 
@@ -1,6 +1,8 @@
1
- require 'baza'
1
+ require "baza"
2
2
 
3
3
  class ActiveRecordStreamer
4
+ RAILS_4 = ActiveRecord::VERSION::STRING.start_with?("4")
5
+
4
6
  def initialize(args = {})
5
7
  @args = args
6
8
  @klass = args[:query].klass
@@ -9,7 +11,7 @@ class ActiveRecordStreamer
9
11
  end
10
12
 
11
13
  def rails4?
12
- @@rails4 ||= ActiveRecord::VERSION::STRING.start_with?('4')
14
+ RAILS_4
13
15
  end
14
16
 
15
17
  def each(&blk)
@@ -43,7 +45,7 @@ class ActiveRecordStreamer
43
45
 
44
46
  yield_cache(cache, &blk) if cache.any?
45
47
  ensure
46
- @baza_db.destroy
48
+ @baza_db.close
47
49
  end
48
50
  end
49
51
 
@@ -1,7 +1,7 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
2
2
 
3
3
  describe "ActiveRecordStreamer" do
4
4
  it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
5
+ raise "hey buddy, you should probably rename this file and start specing for real"
6
6
  end
7
7
  end
@@ -1,4 +1,5 @@
1
- require 'simplecov'
1
+ require "simplecov"
2
+ require "active_record"
2
3
 
3
4
  module SimpleCov::Configuration
4
5
  def clean_filters
@@ -8,22 +9,21 @@ end
8
9
 
9
10
  SimpleCov.configure do
10
11
  clean_filters
11
- load_adapter 'test_frameworks'
12
+ load_adapter "test_frameworks"
12
13
  end
13
14
 
14
15
  ENV["COVERAGE"] && SimpleCov.start do
15
16
  add_filter "/.rvm/"
16
17
  end
17
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
18
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
18
19
  $LOAD_PATH.unshift(File.dirname(__FILE__))
19
20
 
20
- require 'rspec'
21
- require 'active-record-streamer'
21
+ require "rspec"
22
+ require "active-record-streamer"
22
23
 
23
24
  # Requires supporting files with custom matchers and macros, etc,
24
25
  # in ./support/ and its subdirectories.
25
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
26
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
26
27
 
27
28
  RSpec.configure do |config|
28
-
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-record-streamer
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
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-05 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: baza
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.19
19
+ version: 0.0.20
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.19
26
+ version: 0.0.20
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,34 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: best_practice_project
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
139
167
  description: Stream ActiveRecord results
140
168
  email: k@spernj.org
141
169
  executables: []
@@ -146,6 +174,8 @@ extra_rdoc_files:
146
174
  files:
147
175
  - ".document"
148
176
  - ".rspec"
177
+ - ".rubocop.yml"
178
+ - ".rubocop_todo.yml"
149
179
  - Gemfile
150
180
  - Gemfile.lock
151
181
  - LICENSE.txt