a9n 0.9.0 → 0.9.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1281f22d87f9f4d7859fc9502b63c1f0ce4b3ffc2613cffffac04439eb15ce4
4
- data.tar.gz: a654029ddd734466360ff854f7a8f384ed04b4ad3d76a40b7532900ab1a1ddbf
3
+ metadata.gz: d25e665f63827ffa8e6e813bec78b80736dbc6e321659465b7758c70eb7a93d5
4
+ data.tar.gz: '0587ac992772835f359d251375a8565606c812f63796a87b91c978b4bfc7b99f'
5
5
  SHA512:
6
- metadata.gz: ff4729ff94e74c73b5473a2de24faae869f913a9d066f16e666c8d92c8aedbc748bf7c89821dd4197833b4a901a7111f68968b787f8eee4679b4bbed3b89e877
7
- data.tar.gz: 70913ef31b6334875776970fc6b2922e9e97a8e0ccbd983672a8e120f6677ec440d8435436845efe20ac9d0f303c98249566c6a249050b43d62db93406b3cb0c
6
+ metadata.gz: cd9dd712d5e296798537ee5ded3647a11907645da77b0495154e3ff194af381ad45961d3d1c3b269987f78650c3dc1ee8ac24f35f5ad99742801580f528a4d6b
7
+ data.tar.gz: 65f3792eaadc7d9d4cd846992b5669dcedb8924cf6eb7e84c8889ce1925392a621e40974407044385c12afb3a754f1bb61c765b4acf9eea3c14c13350508c354
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'a9n'
5
+ require 'pry'
6
+ require 'irb'
7
+
8
+ IRB.start(__FILE__)
data/lib/a9n.rb CHANGED
@@ -45,13 +45,20 @@ module A9n
45
45
  end
46
46
 
47
47
  def root
48
- @root ||= app_root
48
+ @root ||= app_root || root_from_bundle_env || fail(RootNotSetError)
49
49
  end
50
50
 
51
51
  def app_root
52
52
  app.root if app.respond_to?(:root)
53
53
  end
54
54
 
55
+ def root_from_bundle_env
56
+ return nil unless ENV['BUNDLE_GEMFILE']
57
+ dir = File.dirname(ENV['BUNDLE_GEMFILE'])
58
+ return nil unless File.directory?(dir)
59
+ Pathname.new(dir)
60
+ end
61
+
55
62
  def root=(path)
56
63
  @root = path.to_s.empty? ? nil : Pathname.new(path.to_s).freeze
57
64
  end
@@ -5,4 +5,5 @@ module A9n
5
5
  class NoSuchConfigurationVariableError < StandardError; end
6
6
  class MissingEnvVariableError < StandardError; end
7
7
  class UnknownEnvError < StandardError; end
8
+ class RootNotSetError < StandardError; end
8
9
  end
@@ -1,3 +1,3 @@
1
1
  module A9n
2
- VERSION = '0.9.0'.freeze
2
+ VERSION = '0.9.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a9n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codeclimate-test-reporter
@@ -113,6 +113,7 @@ files:
113
113
  - README.md
114
114
  - Rakefile
115
115
  - a9n.gemspec
116
+ - bin/console
116
117
  - lib/a9n.rb
117
118
  - lib/a9n/capistrano.rb
118
119
  - lib/a9n/capistrano/tasks.cap