feature_map 1.2.5 → 1.2.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 735b90dee1fa2dbc01d10b57bb2b53a8350edb3465c04e11760f19f6613893ce
4
- data.tar.gz: f1bdfbdd9cca2a4f384b60c1598ef3fc0add164607cb51cd7aadc9e06fda1407
3
+ metadata.gz: 20d96ad4e61fb28fc9891cf32dd7e6102dbfb6d48d4a114973390cb5fc2fc805
4
+ data.tar.gz: 951a84a6a993a8b03b7899c51b5e55e3ab3fcf356f90e122574658a3696da5cd
5
5
  SHA512:
6
- metadata.gz: 3d763d8fa726924f6d90653b748ae50d8d82849de44f20cc2de72affa2ddddd20d537d2dab2079767a72cdc33bd7fd6442c3d3cb93275b8ddfd34392001182b7
7
- data.tar.gz: 7c21f6d7e0d9e1da75fd0ec638041e20c0be5997af75ed0fb8ac49be213c7066b2c2bf488f84939c6b0eb741435325946859c66bc5fd14d3b91a13c90c7832e4
6
+ metadata.gz: 3256049f99d24a887bc0644cbb64a1c7bcd8a305b23b019a864d68f84c101b342e742d236dfe85d1739cbc88dc4a42130b7fc25e5fc4de744a939f2ea3a77934
7
+ data.tar.gz: 57f6b8091fa32823b5f199c0f0cad7fa8b0be3b15eabb9ecee7f16e2357be7234cd2931a8f2a6ecf984792b7a56103f9956a3241c2cae9130c0cfe48e9baf7da
data/README.md CHANGED
@@ -31,8 +31,8 @@ Contributions are welcome and appreciated. Here's how to get started:
31
31
 
32
32
  - clone repo: `$ git clone git@github.com:Beyond-Finance/feature_map.git`
33
33
  - install dependencies: `$ bundle install`
34
- - run tests: `$ bundle exec rspec`
35
- - run Rubocop: `$ bundle exec rubocop`
34
+ - run tests: `$ bin/rspec`
35
+ - run Rubocop: `$ bin/rubocop`
36
36
 
37
37
  That's it! Assuming you can complete all of these steps without any error or issues, you should be good to go.
38
38
 
data/bin/bundle ADDED
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'rubygems'
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV.fetch('BUNDLER_VERSION', nil)
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless 'update'.start_with?(ARGV.first || ' ') # must be running `bundle update`
27
+
28
+ bundler_version = nil
29
+ update_index = nil
30
+ ARGV.each_with_index do |a, i|
31
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
32
+ bundler_version = a
33
+ end
34
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
35
+
36
+ bundler_version = Regexp.last_match(1)
37
+ update_index = i
38
+ end
39
+ bundler_version
40
+ end
41
+
42
+ def gemfile
43
+ gemfile = ENV.fetch('BUNDLE_GEMFILE', nil)
44
+ return gemfile if gemfile && !gemfile.empty?
45
+
46
+ File.expand_path('../Gemfile', __dir__)
47
+ end
48
+
49
+ def lockfile
50
+ lockfile =
51
+ case File.basename(gemfile)
52
+ when 'gems.rb' then gemfile.sub(/\.rb$/, '.locked')
53
+ else "#{gemfile}.lock"
54
+ end
55
+ File.expand_path(lockfile)
56
+ end
57
+
58
+ def lockfile_version
59
+ return unless File.file?(lockfile)
60
+
61
+ lockfile_contents = File.read(lockfile)
62
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
63
+
64
+ Regexp.last_match(1)
65
+ end
66
+
67
+ def bundler_requirement
68
+ @bundler_requirement ||=
69
+ env_var_version ||
70
+ cli_arg_version ||
71
+ bundler_requirement_for(lockfile_version)
72
+ end
73
+
74
+ def bundler_requirement_for(version)
75
+ return "#{Gem::Requirement.default}.a" unless version
76
+
77
+ bundler_gem_version = Gem::Version.new(version)
78
+
79
+ bundler_gem_version.approximate_recommendation
80
+ end
81
+
82
+ def load_bundler!
83
+ ENV['BUNDLE_GEMFILE'] ||= gemfile
84
+
85
+ activate_bundler
86
+ end
87
+
88
+ def activate_bundler
89
+ gem_error = activation_error_handling do
90
+ gem 'bundler', bundler_requirement
91
+ end
92
+ return if gem_error.nil?
93
+
94
+ require_error = activation_error_handling do
95
+ require 'bundler/version'
96
+ end
97
+ return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98
+
99
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
100
+ exit 42
101
+ end
102
+
103
+ def activation_error_handling
104
+ yield
105
+ nil
106
+ rescue StandardError, LoadError => e
107
+ e
108
+ end
109
+ end
110
+
111
+ m.load_bundler!
112
+
113
+ if m.invoked_as_script?
114
+ load Gem.bin_path('bundler', 'bundle')
115
+ end
data/bin/docs CHANGED
@@ -12,8 +12,8 @@ if [ ! -f $COVERAGE_FILE ] || [ $(find $COVERAGE_FILE -mtime +7 -print 2>/dev/nu
12
12
  echo "# No test coverage file found. Regenerating. #"
13
13
  echo "###############################################"
14
14
 
15
- bundle exec rspec
16
- bundle exec featuremap test_coverage --use-simplecov --simplecov-path $COVERAGE_FILE
15
+ bin/rspec
16
+ bin/featuremap test_coverage --use-simplecov --simplecov-path $COVERAGE_FILE
17
17
  else
18
18
  echo "#############################################################"
19
19
  echo "# Using recent coverage file. If you'd like to regenerate: #"
@@ -21,7 +21,7 @@ else
21
21
  echo "#############################################################"
22
22
  fi
23
23
 
24
- bundle exec featuremap docs
24
+ bin/featuremap docs
25
25
  cat .feature_map/docs/feature-map-config.js | sed 's/window\.FEATURE_MAP_CONFIG = /export const sampleConfig = /' > docs/sample_config.js
26
- cd docs && npm install && cd ..
26
+ cd docs && npm install && npm run lint:fix && cd ..
27
27
  exec foreman start -f Procfile.docs "$@"
data/bin/featuremap CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # NOTE: bundler/setup is required to reference local library code
4
+ # rather than a system installed version of feature_map.
5
+ require 'bundler/setup'
3
6
  require 'feature_map'
4
7
  FeatureMap::Cli.run!(ARGV)
data/bin/jekyll ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'jekyll' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
12
+
13
+ bundle_binstub = File.expand_path('bundle', __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require 'rubygems'
25
+ require 'bundler/setup'
26
+
27
+ load Gem.bin_path('jekyll', 'jekyll')
data/bin/readme CHANGED
@@ -6,4 +6,5 @@ if ! gem list foreman -i --silent; then
6
6
  fi
7
7
 
8
8
  cp ./lib/feature_map/private/docs/index.html ./readme/example-docs-site.html
9
+ cd readme && npm i && cd ..
9
10
  exec foreman start -f Procfile.readme "$@"
data/bin/rspec ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
12
+
13
+ bundle_binstub = File.expand_path('bundle', __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require 'rubygems'
25
+ require 'bundler/setup'
26
+
27
+ load Gem.bin_path('rspec-core', 'rspec')
data/bin/rubocop ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
12
+
13
+ bundle_binstub = File.expand_path('bundle', __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require 'rubygems'
25
+ require 'bundler/setup'
26
+
27
+ load Gem.bin_path('rubocop', 'rubocop')