peak_flow_utils 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ea418495b5cc8d0346fcd544e923abcd3cb3784a
4
+ data.tar.gz: c5868fb678b6f32c96b7ddbb6709ddc1f20dea8b
5
+ SHA512:
6
+ metadata.gz: 165a3f792d3fac258ba3e1859e768d750de7a41f0e2262de9b1f6bdfa7b74d8b21d3a79f544a04d4609128c452caf3d9df288e63fe84e02b83f741d4ee5ea141
7
+ data.tar.gz: 47d5a2875d4f182496d1c77e157060b242fce1f7922a40ca28cbe638a68804e31b04b1e04e467784bdb4733a00e038a05cbc616669746ee62f321433fc694979
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,83 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ DisplayStyleGuide: true
4
+ Exclude:
5
+ - db/schema.rb
6
+ - spec/dummy/db/schema.rb
7
+
8
+ # https://github.com/AtomLinter/linter-rubocop/issues/2
9
+ Style/FileName:
10
+ Enabled: false
11
+
12
+ Metrics/CyclomaticComplexity:
13
+ Max: 10
14
+
15
+ Metrics/LineLength:
16
+ Max: 160
17
+
18
+ Metrics/MethodLength:
19
+ Max: 50
20
+
21
+ Metrics/AbcSize:
22
+ Max: 25
23
+
24
+ Metrics/ClassLength:
25
+ Max: 250
26
+
27
+ # .find_each is not the same as .each
28
+ Rails/FindEach:
29
+ Enabled: false
30
+
31
+ Style/AccessModifierIndentation:
32
+ EnforcedStyle: outdent
33
+
34
+ Style/AlignParameters:
35
+ EnforcedStyle: with_fixed_indentation
36
+
37
+ Style/ClassAndModuleChildren:
38
+ EnforcedStyle: compact
39
+
40
+ Style/ConditionalAssignment:
41
+ Enabled: false
42
+
43
+ Style/Documentation:
44
+ Enabled: false
45
+
46
+ Style/EmptyLines:
47
+ Enabled: false
48
+
49
+ # Will report offences for many places that are much more readable without using a guard clause
50
+ Style/GuardClause:
51
+ Enabled: false
52
+
53
+ Style/MultilineMethodCallIndentation:
54
+ EnforcedStyle: indented
55
+
56
+ Style/MultilineOperationIndentation:
57
+ EnforcedStyle: indented
58
+
59
+ Style/StringLiterals:
60
+ EnforcedStyle: double_quotes
61
+
62
+ Style/StringLiteralsInInterpolation:
63
+ Enabled: false
64
+
65
+ Style/NilComparison:
66
+ Enabled: false
67
+
68
+ Style/SignalException:
69
+ EnforcedStyle: only_raise
70
+
71
+ Style/MultilineOperationIndentation:
72
+ EnforcedStyle: indented
73
+
74
+ Style/SpaceInsideHashLiteralBraces:
75
+ EnforcedStyle: no_space
76
+
77
+ Style/TrivialAccessors:
78
+ ExactNameMatch: true
79
+ Enabled: true
80
+
81
+ # Disabled on purpose: https://github.com/bbatsov/rubocop/issues/1758
82
+ Style/ClosingParenthesisIndentation:
83
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ source "https://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "bundler", "1.12.5"
10
+ gem "jeweler", "2.1.1"
11
+ end
12
+
13
+ group :development, :test do
14
+ gem "best_practice_project", "0.0.8", require: false
15
+ gem "rubocop", "0.43.0"
16
+ end
17
+
18
+ group :test do
19
+ gem "rspec", "3.5.0"
20
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,93 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.4.0)
5
+ ast (2.3.0)
6
+ auto_autoloader (0.0.5)
7
+ string-cases
8
+ best_practice_project (0.0.8)
9
+ auto_autoloader
10
+ builder (3.2.2)
11
+ descendants_tracker (0.0.4)
12
+ thread_safe (~> 0.3, >= 0.3.1)
13
+ diff-lcs (1.2.5)
14
+ faraday (0.9.2)
15
+ multipart-post (>= 1.2, < 3)
16
+ git (1.3.0)
17
+ github_api (0.14.5)
18
+ addressable (~> 2.4.0)
19
+ descendants_tracker (~> 0.0.4)
20
+ faraday (~> 0.8, < 0.10)
21
+ hashie (>= 3.4)
22
+ oauth2 (~> 1.0)
23
+ hashie (3.4.6)
24
+ highline (1.7.8)
25
+ jeweler (2.1.1)
26
+ builder
27
+ bundler (>= 1.0)
28
+ git (>= 1.2.5)
29
+ github_api
30
+ highline (>= 1.6.15)
31
+ nokogiri (>= 1.5.10)
32
+ rake
33
+ rdoc
34
+ semver
35
+ json (1.8.3)
36
+ jwt (1.5.6)
37
+ mini_portile2 (2.1.0)
38
+ multi_json (1.12.1)
39
+ multi_xml (0.5.5)
40
+ multipart-post (2.0.0)
41
+ nokogiri (1.6.8.1)
42
+ mini_portile2 (~> 2.1.0)
43
+ oauth2 (1.2.0)
44
+ faraday (>= 0.8, < 0.10)
45
+ jwt (~> 1.0)
46
+ multi_json (~> 1.3)
47
+ multi_xml (~> 0.5)
48
+ rack (>= 1.2, < 3)
49
+ parser (2.3.1.4)
50
+ ast (~> 2.2)
51
+ powerpack (0.1.1)
52
+ rack (2.0.1)
53
+ rainbow (2.1.0)
54
+ rake (11.3.0)
55
+ rdoc (4.2.2)
56
+ json (~> 1.4)
57
+ rspec (3.5.0)
58
+ rspec-core (~> 3.5.0)
59
+ rspec-expectations (~> 3.5.0)
60
+ rspec-mocks (~> 3.5.0)
61
+ rspec-core (3.5.4)
62
+ rspec-support (~> 3.5.0)
63
+ rspec-expectations (3.5.0)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.5.0)
66
+ rspec-mocks (3.5.0)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.5.0)
69
+ rspec-support (3.5.0)
70
+ rubocop (0.43.0)
71
+ parser (>= 2.3.1.1, < 3.0)
72
+ powerpack (~> 0.1)
73
+ rainbow (>= 1.99.1, < 3.0)
74
+ ruby-progressbar (~> 1.7)
75
+ unicode-display_width (~> 1.0, >= 1.0.1)
76
+ ruby-progressbar (1.8.1)
77
+ semver (1.0.1)
78
+ string-cases (0.0.4)
79
+ thread_safe (0.3.5)
80
+ unicode-display_width (1.1.1)
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ best_practice_project (= 0.0.8)
87
+ bundler (= 1.12.5)
88
+ jeweler (= 2.1.1)
89
+ rspec (= 3.5.0)
90
+ rubocop (= 0.43.0)
91
+
92
+ BUNDLED WITH
93
+ 1.12.5
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2016 kaspernj
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.
data/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # peak_flow_utils
2
+
3
+ Description goes here.
4
+
5
+ ## Contributing to peak_flow_utils
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ ## Copyright
16
+
17
+ Copyright (c) 2016 kaspernj. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,37 @@
1
+ # encoding: utf-8
2
+
3
+ require "rubygems"
4
+ require "bundler"
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require "rake"
13
+
14
+ require "jeweler"
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "peak_flow_utils"
18
+ gem.homepage = "http://github.com/kaspernj/peak_flow_utils"
19
+ gem.license = "MIT"
20
+ gem.summary = %(Various utilities to help with building on PeakFlow)
21
+ gem.description = %(Various utilities to help with building on PeakFlow)
22
+ gem.email = "k@spernj.org"
23
+ gem.authors = ["kaspernj"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require "rspec/core"
29
+ require "rspec/core/rake_task"
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList["spec/**/*_spec.rb"]
32
+ end
33
+
34
+ require "best_practice_project"
35
+ BestPracticeProject.load_tasks
36
+
37
+ task default: :spec
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This task detects and prints out the RSpec files for the current build group
4
+
5
+ require "peak_flow_utils"
6
+
7
+ rspec_helper = PeakFlowUtils::RspecHelper.new(
8
+ groups: args[:groups].to_i,
9
+ group_number: args[:group_number].to_i
10
+ )
11
+
12
+ print rspec_helper.group_files.join(" ")
@@ -0,0 +1,3 @@
1
+ class PeakFlowUtils
2
+ autoload :RspecHelper, "#{File.dirname(__FILE__)}/peak_flow_utils/rspec_helper"
3
+ end
@@ -0,0 +1,53 @@
1
+ class PeakFlowUtils::RspecHelper
2
+ def initialize(args)
3
+ @groups = args.fetch(:groups)
4
+ @group_number = args.fetch(:group_number)
5
+ end
6
+
7
+ def group_files
8
+ return @group_files if @group_files
9
+
10
+ # Sort them so that they are sorted by file path in three groups so each group have an equal amount of controller specs, features specs and so on
11
+ group_orders = []
12
+ @groups.times do
13
+ group_orders << []
14
+ end
15
+
16
+ group_index = 0
17
+ files.sort.each do |file|
18
+ group_orders[group_index] << file
19
+ group_index += 1
20
+ group_index = 0 if group_index >= group_orders.length
21
+ end
22
+
23
+ @group_files = group_orders[@group_number - 1]
24
+ end
25
+
26
+ def total_tests
27
+ files unless @total_tests
28
+ @total_tests
29
+ end
30
+
31
+ private
32
+
33
+ def dry_result
34
+ @dry_result ||= JSON.parse(`bundle exec rspec --dry-run --format json`)
35
+ end
36
+
37
+ def files
38
+ return @files if @files
39
+
40
+ @total_tests = 0
41
+
42
+ @files = []
43
+ dry_result.fetch("examples").each do |example|
44
+ file_path = example.fetch("file_path")
45
+ file_path = file_path[2, file_path.length]
46
+
47
+ @files << file_path unless @files.include?(file_path)
48
+ @total_tests += 1
49
+ end
50
+
51
+ @files
52
+ end
53
+ end
@@ -0,0 +1,65 @@
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
+ # stub: peak_flow_utils 0.0.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "peak_flow_utils"
9
+ s.version = "0.0.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["kaspernj"]
14
+ s.date = "2016-10-08"
15
+ s.description = "Various utilities to help with building on PeakFlow"
16
+ s.email = "k@spernj.org"
17
+ s.executables = ["peak_flow_rspec_files"]
18
+ s.extra_rdoc_files = [
19
+ "LICENSE.txt",
20
+ "README.md"
21
+ ]
22
+ s.files = [
23
+ ".document",
24
+ ".rspec",
25
+ ".rubocop.yml",
26
+ "Gemfile",
27
+ "Gemfile.lock",
28
+ "LICENSE.txt",
29
+ "README.md",
30
+ "Rakefile",
31
+ "VERSION",
32
+ "bin/peak_flow_rspec_files",
33
+ "lib/peak_flow_utils.rb",
34
+ "lib/peak_flow_utils/rspec_helper.rb",
35
+ "peak_flow_utils.gemspec",
36
+ "spec/peak_flow_utils_spec.rb",
37
+ "spec/spec_helper.rb"
38
+ ]
39
+ s.homepage = "http://github.com/kaspernj/peak_flow_utils"
40
+ s.licenses = ["MIT"]
41
+ s.rubygems_version = "2.5.1"
42
+ s.summary = "Various utilities to help with building on PeakFlow"
43
+
44
+ if s.respond_to? :specification_version then
45
+ s.specification_version = 4
46
+
47
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
+ s.add_development_dependency(%q<bundler>, ["= 1.12.5"])
49
+ s.add_development_dependency(%q<jeweler>, ["= 2.1.1"])
50
+ s.add_development_dependency(%q<best_practice_project>, ["= 0.0.8"])
51
+ s.add_development_dependency(%q<rubocop>, ["= 0.43.0"])
52
+ else
53
+ s.add_dependency(%q<bundler>, ["= 1.12.5"])
54
+ s.add_dependency(%q<jeweler>, ["= 2.1.1"])
55
+ s.add_dependency(%q<best_practice_project>, ["= 0.0.8"])
56
+ s.add_dependency(%q<rubocop>, ["= 0.43.0"])
57
+ end
58
+ else
59
+ s.add_dependency(%q<bundler>, ["= 1.12.5"])
60
+ s.add_dependency(%q<jeweler>, ["= 2.1.1"])
61
+ s.add_dependency(%q<best_practice_project>, ["= 0.0.8"])
62
+ s.add_dependency(%q<rubocop>, ["= 0.43.0"])
63
+ end
64
+ end
65
+
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
2
+
3
+ describe "PeakFlowUtils" do
4
+ it "fails" do
5
+ raise "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,28 @@
1
+ require "simplecov"
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter "test_frameworks"
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
17
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
18
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
19
+
20
+ require "rspec"
21
+ require "peak_flow_utils"
22
+
23
+ # Requires supporting files with custom matchers and macros, etc,
24
+ # in ./support/ and its subdirectories.
25
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
26
+
27
+ RSpec.configure do |config|
28
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: peak_flow_utils
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - kaspernj
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.12.5
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.12.5
27
+ - !ruby/object:Gem::Dependency
28
+ name: jeweler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 2.1.1
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 2.1.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: best_practice_project
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.8
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.8
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.43.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.43.0
69
+ description: Various utilities to help with building on PeakFlow
70
+ email: k@spernj.org
71
+ executables:
72
+ - peak_flow_rspec_files
73
+ extensions: []
74
+ extra_rdoc_files:
75
+ - LICENSE.txt
76
+ - README.md
77
+ files:
78
+ - ".document"
79
+ - ".rspec"
80
+ - ".rubocop.yml"
81
+ - Gemfile
82
+ - Gemfile.lock
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - VERSION
87
+ - bin/peak_flow_rspec_files
88
+ - lib/peak_flow_utils.rb
89
+ - lib/peak_flow_utils/rspec_helper.rb
90
+ - peak_flow_utils.gemspec
91
+ - spec/peak_flow_utils_spec.rb
92
+ - spec/spec_helper.rb
93
+ homepage: http://github.com/kaspernj/peak_flow_utils
94
+ licenses:
95
+ - MIT
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.5.1
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Various utilities to help with building on PeakFlow
117
+ test_files: []