chino 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4da659d86b5e3ae384837286eb333a02ccb54e12
4
- data.tar.gz: 7de1b30e5d73295bd55b67232e8bad8feaa9a110
3
+ metadata.gz: e61d646b735bb720f067b2a0a97ab8fc1e557504
4
+ data.tar.gz: 3025c568260ed0a1d56fbb6e70af138e1cd0bcb3
5
5
  SHA512:
6
- metadata.gz: 67966625c1c855f8fb4ea08242d8dec0636b646643bfb7685a16275db9fde1842e254fd2d02772f9fa6842e9ce3e648f0e642b14e6da77a50824803c8948588f
7
- data.tar.gz: 9052022747bd6bc163626243319afcd97c3ffb4d72f8e43b53f7c3462e94e355a74555bc7302025a1ce2b428db07d1a85c9235ae0b08d625048ae1126c57df65
6
+ metadata.gz: 41b58c4c0d29234adc65474d89309594e46da17a7c69245303f0244d4dcf1d62f37817646fd0facff96247f9d6168eb154c9d17803d8f0fc17991e32c9a07e47
7
+ data.tar.gz: 85f970a125b942dffb84a540d380974a32bfa60607d1c42839f9e33227685b11fcc855afa0dc8fa22b1c163a8ffcbaed6df4cf599bdf4a100611892229ba30d4
data/exe/chino CHANGED
@@ -23,7 +23,17 @@ if command == "build"
23
23
  FileUtils.rm_r("temp") if Dir.exists?("temp")
24
24
  FileUtils.mkdir("temp")
25
25
  FileUtils.cp_r("Resources", "temp") if Dir.exists?("Resources")
26
- Dir["./**/*.j"].each {|file| FileUtils.cp(file, "temp")}
26
+
27
+ base_path = File.expand_path("./")
28
+ puts "base_path: #{base_path}"
29
+
30
+ Dir["./**/*.j"].each do |file|
31
+ cur_path = File.expand_path(file)
32
+ rel_path = cur_path.sub( Regexp.new("^#{base_path}"), "" )
33
+
34
+ FileUtils.mkdir_p( File.join("temp", File.dirname(rel_path)) )
35
+ FileUtils.cp( cur_path, File.join("temp", rel_path) )
36
+ end
27
37
 
28
38
  config.collect_exports.each do |k,v|
29
39
  FileUtils.mkdir_p( File.join("temp", File.dirname(k)) )
@@ -54,7 +54,32 @@ module Chino
54
54
  @information[:exports][filename] = File.join(@information[:path], filename)
55
55
  end
56
56
 
57
- def imports(the_name, path:nil)
57
+ def imports(the_name, path: nil, version: nil)
58
+
59
+ if path == nil
60
+ # this means that the package is downloaded somewhere already
61
+ base_dir = "#{ENV['HOME']}/.chino/dependencies/#{the_name}"
62
+
63
+ if !Dir.exists?("#{ENV['HOME']}/.chino/dependencies/#{the_name}")
64
+ throw "The bundle '#{the_name}' has not been installed. Please run chino install."
65
+ end
66
+
67
+ version_list = Dir["#{base_dir}/*"].sort_by{|x| x}.reverse
68
+
69
+ if version_list.count == 0
70
+ throw "The bundle '#{the_name}' has not been installed. Please run chino install."
71
+ end
72
+
73
+ if version
74
+ if !Dir.exists?("#{base_dir}/#{version}")
75
+ throw "The bundle '#{the_name}' with version #{version} has not been installed. Please run chino install."
76
+ end
77
+ path = "#{base_dir}/#{version}"
78
+ else
79
+ path = version_list.first
80
+ end
81
+
82
+ end
58
83
 
59
84
  file = File.join(path, "Chinofile")
60
85
  dep_chinofile = Chinofile.new(path: path) do
@@ -1,3 +1,3 @@
1
1
  module Chino
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Siaw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2017-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra