chino 0.1.3 → 0.1.4

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: 80b54cafae0b324c13f478b46d28dce45d39449d
4
- data.tar.gz: 4d5a4247ee4b6d79cb458eaae004705e7eb6a09e
3
+ metadata.gz: 4da659d86b5e3ae384837286eb333a02ccb54e12
4
+ data.tar.gz: 7de1b30e5d73295bd55b67232e8bad8feaa9a110
5
5
  SHA512:
6
- metadata.gz: 9466dbbbe739c45d58c89c0368ac24eff9f888d479acddbee1e9a7fd434f80432f58e5a88b0a742fe7e877fd683e501ae2ad3a7be6843c152d75a033fc703cb7
7
- data.tar.gz: 1e51e366e6cf36eaaae37f6db7980cc9f52df9465f2e569ced88a6b3bc095bd5ed616c2e34d80aafe114f1f1b3b115c424844c8280f4f5c7d55f377ecc1cf521
6
+ metadata.gz: 67966625c1c855f8fb4ea08242d8dec0636b646643bfb7685a16275db9fde1842e254fd2d02772f9fa6842e9ce3e648f0e642b14e6da77a50824803c8948588f
7
+ data.tar.gz: 9052022747bd6bc163626243319afcd97c3ffb4d72f8e43b53f7c3462e94e355a74555bc7302025a1ce2b428db07d1a85c9235ae0b08d625048ae1126c57df65
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CPBundleIdentifier</key>
6
+ <string><%= dep_bundle_identifier %></string>
7
+ <key>CPBundleInfoDictionaryVersion</key>
8
+ <string>6.0</string>
9
+ <key>CPBundleName</key>
10
+ <string><%= dep_bundle_name %></string>
11
+ <key>CPBundlePackageType</key>
12
+ <string>FMWK</string>
13
+ </dict>
14
+ </plist>
data/exe/chino CHANGED
@@ -22,14 +22,22 @@ if command == "build"
22
22
  FileUtils.rm_r("build") if Dir.exists?("build")
23
23
  FileUtils.rm_r("temp") if Dir.exists?("temp")
24
24
  FileUtils.mkdir("temp")
25
- FileUtils.cp_r("#{config.data_path}/common/Frameworks", "temp")
26
25
  FileUtils.cp_r("Resources", "temp") if Dir.exists?("Resources")
27
26
  Dir["./**/*.j"].each {|file| FileUtils.cp(file, "temp")}
27
+
28
+ config.collect_exports.each do |k,v|
29
+ FileUtils.mkdir_p( File.join("temp", File.dirname(k)) )
30
+ FileUtils.cp(v, File.join("temp", k))
31
+ end
32
+
33
+ FileUtils.cp_r("#{config.data_path}/common/Frameworks", "temp")
34
+
28
35
  Dir["#{config.data_path}/common/*"].select{|x|File.file? x}.each do |file|
29
36
  filename = File.basename(file, ".erb")
30
37
  file_content = config.get_file(filename)[:string]
31
38
  File.write("temp/#{filename}", file_content)
32
39
  end
40
+
33
41
  IO.popen('cd temp && jake deploy') do |io|
34
42
  while (line = io.gets) do
35
43
  puts line
@@ -4,9 +4,11 @@ module Chino
4
4
 
5
5
  attr_accessor :information
6
6
 
7
- def initialize(&block)
7
+ def initialize(path: "#{`pwd`.chomp}", &block)
8
8
  @information = {
9
- dependencies: []
9
+ path: path,
10
+ dependencies: {},
11
+ exports: {}
10
12
  }
11
13
  instance_eval(&block)
12
14
 
@@ -15,7 +17,7 @@ module Chino
15
17
  @information[:author] ||= "Incognito"
16
18
  @information[:author_email] ||= "incognito@example.com"
17
19
  @information[:company_name] ||= "#{@information[:author]}"
18
- @information[:identifier] ||= "com.#{@information[:company_name].downcase.gsub(/[^a-z0-9]+/, "_")}.#{@information[:name].gsub(/[^a-z0-9]+/, "_")}"
20
+ @information[:identifier] ||= "com.#{@information[:company_name].downcase.gsub(/[^a-z0-9]+/, "_")}.#{@information[:name].downcase.gsub(/[^a-z0-9]+/, "_")}"
19
21
  @information[:created_at] ||= Time.now
20
22
 
21
23
  end
@@ -48,7 +50,36 @@ module Chino
48
50
  @information[:created_at] = value
49
51
  end
50
52
 
51
- def imports(name, version:nil, path:nil)
53
+ def exports(filename)
54
+ @information[:exports][filename] = File.join(@information[:path], filename)
55
+ end
56
+
57
+ def imports(the_name, path:nil)
58
+
59
+ file = File.join(path, "Chinofile")
60
+ dep_chinofile = Chinofile.new(path: path) do
61
+ proc = Proc.new {}
62
+ eval File.read(file), proc.binding, file
63
+ end
64
+
65
+ if the_name != dep_chinofile.information[:name]
66
+ throw "Name of the bundle specified is not the same as the one in #{path}"
67
+ end
68
+
69
+ @information[:dependencies][the_name] = dep_chinofile
70
+ end
71
+
72
+ def find_file(filename)
73
+ return @information[:exports][filename] if @information[:exports][filename]
74
+
75
+ @information[:dependencies].map{|k,v| v.find_file(filename)}.select{|x| x}.first
76
+ end
77
+
78
+ def collect_exports
79
+ all = {}
80
+ @information[:dependencies].each {|k,chinofile| chinofile.collect_exports.each {|k,v| all[k] = v } }
81
+ @information[:exports].each { |k,v| all[k] = v }
82
+ return all
52
83
  end
53
84
  end
54
85
  end
data/lib/chino/config.rb CHANGED
@@ -47,6 +47,7 @@ module Chino
47
47
  end
48
48
 
49
49
  def get_file(file)
50
+
50
51
  if File.exists?("#{file}")
51
52
  {
52
53
  filename: "#{file}"
@@ -60,9 +61,17 @@ module Chino
60
61
  {
61
62
  filename: "#{common_path}/#{file}"
62
63
  }
64
+ elsif @chinofile.find_file(file)
65
+ {
66
+ filename: "#{@chinofile.find_file(file)}"
67
+ }
63
68
  else
64
69
  {}
65
70
  end
66
71
  end
72
+
73
+ def collect_exports
74
+ exports = @chinofile.collect_exports
75
+ end
67
76
  end
68
- end
77
+ end
data/lib/chino/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chino
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
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-04-27 00:00:00.000000000 Z
11
+ date: 2017-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -2569,6 +2569,7 @@ files:
2569
2569
  - data/chino/skeleton/Chinofile
2570
2570
  - data/chino/skeleton/main.j
2571
2571
  - data/chino/templates/class.j.erb
2572
+ - data/chino/templates/fmwk.info.plist.erb
2572
2573
  - exe/chino
2573
2574
  - lib/chino.rb
2574
2575
  - lib/chino/chinofile.rb