simpli 0.0.1

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: b01bf33cf25abe63248e9c4faa041f8c26cfd683
4
+ data.tar.gz: ed21f8600ac6e377c4e51618e8cdc666033c7b14
5
+ SHA512:
6
+ metadata.gz: b1d98f88792ca840f88adfa4a5c4b065572dda2e7d60c9c3d6d3a85b53b439e52618c0f81b1e76b1a7d310b55b1e86c1825101431017cabc8bd5489635ba8ada
7
+ data.tar.gz: 7b8feb62d57ba51c9f3bcc3e4661b14ce207f8bb458d82eae66161711d750a18bc3e1a489be8f267efa34d8f733e9778619d976437588bd960f12af9bd8167bf
data/bin/simpli ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'simpli'
4
+
5
+ simply_script_path = Simpli.locate_simply_script
6
+
7
+ raise '***ERROR: Simply script could not be found' unless simply_script_path
8
+
9
+ command = [simply_script_path, ARGV].flatten.join(' ')
10
+ puts "calling '#{command}'"
11
+ exec(command)
@@ -0,0 +1,29 @@
1
+ module Simpli
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
11
+ end
12
+
13
+ def upsearch(dir_path)
14
+ return if dir_path == '/'
15
+ path_to_simply_script(dir_path) || search_in_parent_directory(dir_path)
16
+ end
17
+
18
+ private
19
+
20
+ def path_to_simply_script(dir_path)
21
+ Dir.glob("#{dir_path}/#{SIMPLY_SCRIPT_RELATIVE_PATH}").first
22
+ end
23
+
24
+ def search_in_parent_directory(dir_path)
25
+ parent_directory = File.expand_path('..', dir_path)
26
+ upsearch(parent_directory)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,3 @@
1
+ module Simpli
2
+ VERSION = '0.0.1'.freeze
3
+ end
data/lib/simpli.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'simpli/version'
2
+ require 'simpli/script_finder'
3
+
4
+ module Simpli
5
+ class << self
6
+ def locate_simply_script
7
+ Simpli::ScriptFinder.find
8
+ end
9
+ end
10
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simpli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mario Schüttel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-01-29 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email: mario.schuettel@simplificator.com
15
+ executables:
16
+ - simpli
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/simpli
21
+ - lib/simpli.rb
22
+ - lib/simpli/script_finder.rb
23
+ - lib/simpli/version.rb
24
+ homepage: https://rubygems.org/gems/simpli
25
+ licenses:
26
+ - Apache-2.0
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.6.10
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: gem for simplificators
48
+ test_files: []