simpli 0.0.1 → 0.0.3

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
  SHA1:
3
- metadata.gz: b01bf33cf25abe63248e9c4faa041f8c26cfd683
4
- data.tar.gz: ed21f8600ac6e377c4e51618e8cdc666033c7b14
3
+ metadata.gz: 73bad84441a3fd12e066004667bda760c981b97f
4
+ data.tar.gz: 5dd4231917b74608b6dd3b121f30289bf330e7b0
5
5
  SHA512:
6
- metadata.gz: b1d98f88792ca840f88adfa4a5c4b065572dda2e7d60c9c3d6d3a85b53b439e52618c0f81b1e76b1a7d310b55b1e86c1825101431017cabc8bd5489635ba8ada
7
- data.tar.gz: 7b8feb62d57ba51c9f3bcc3e4661b14ce207f8bb458d82eae66161711d750a18bc3e1a489be8f267efa34d8f733e9778619d976437588bd960f12af9bd8167bf
6
+ metadata.gz: 319b684bb349f3579002a1d48f4deea54e2c37accb33b0f61386dfe7373d821d845aae1ce27ad436ee97a5847e29d8986c7cccd4e5c6dfb39d6d4ed1de4d152c
7
+ data.tar.gz: 91094eac95feaba5efa509da6b5ece8a8e7f3f760f1c23f860711cfb55a1827a16586f557d081cfec4fd30a8314501e94cbf7e9c3ebddf215cbf7fd076e96977
@@ -2,10 +2,10 @@
2
2
 
3
3
  require 'simpli'
4
4
 
5
- simply_script_path = Simpli.locate_simply_script
5
+ simply_script_path = Simpli.locate_script('./simply')
6
6
 
7
7
  raise '***ERROR: Simply script could not be found' unless simply_script_path
8
8
 
9
9
  command = [simply_script_path, ARGV].flatten.join(' ')
10
- puts "calling '#{command}'"
10
+
11
11
  exec(command)
@@ -1,13 +1,7 @@
1
1
  module Simpli
2
2
  class ScriptFinder
3
- SIMPLY_SCRIPT_RELATIVE_PATH = 'bin/simply'.freeze
4
-
5
- class << self
6
- def find(start_dir)
7
- script_finder = Simpli::ScriptFinder.new
8
- dir_path = File.expand_path(start_dir || Dir.pwd)
9
- script_finder.upsearch(dir_path)
10
- end
3
+ def initialize(relative_script_path)
4
+ @relative_script_path = relative_script_path
11
5
  end
12
6
 
13
7
  def upsearch(dir_path)
@@ -18,7 +12,7 @@ module Simpli
18
12
  private
19
13
 
20
14
  def path_to_simply_script(dir_path)
21
- Dir.glob("#{dir_path}/#{SIMPLY_SCRIPT_RELATIVE_PATH}").first
15
+ Dir.glob("#{dir_path}/#{@relative_script_path}").first
22
16
  end
23
17
 
24
18
  def search_in_parent_directory(dir_path)
@@ -1,3 +1,3 @@
1
1
  module Simpli
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
data/lib/simpli.rb CHANGED
@@ -3,8 +3,10 @@ require 'simpli/script_finder'
3
3
 
4
4
  module Simpli
5
5
  class << self
6
- def locate_simply_script
7
- Simpli::ScriptFinder.find
6
+ def locate_script(script_name, start_dir = Dir.pwd)
7
+ script_finder = Simpli::ScriptFinder.new(script_name)
8
+ dir_path = File.expand_path(start_dir)
9
+ script_finder.upsearch(dir_path)
8
10
  end
9
11
  end
10
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Schüttel
@@ -13,11 +13,11 @@ dependencies: []
13
13
  description:
14
14
  email: mario.schuettel@simplificator.com
15
15
  executables:
16
- - simpli
16
+ - simply
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - bin/simpli
20
+ - bin/simply
21
21
  - lib/simpli.rb
22
22
  - lib/simpli/script_finder.rb
23
23
  - lib/simpli/version.rb