chino 0.1.2 → 0.1.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: 3a21b34570bf076ca41c535a17e61c33255328f1
4
- data.tar.gz: a6f1ba87b7d7df41f1d1c373b8ab31e12bc48b55
3
+ metadata.gz: 80b54cafae0b324c13f478b46d28dce45d39449d
4
+ data.tar.gz: 4d5a4247ee4b6d79cb458eaae004705e7eb6a09e
5
5
  SHA512:
6
- metadata.gz: b1668d58e75aa5e6acbf09175c3f246f7e4393dbd855fa2c8f3f5b0263f375c115f1bbe4fa121d960a9e163f38ad2be7f3f5a0da89c7a7bd76f20a7dc95f252e
7
- data.tar.gz: 995df8fdfe6c5230ce6e810c672bd1c167fe3e69c93109c7e86401dc510af3047bafebe42f74251bd65e6fa1dd30d2fc45c31542e4f1134e1bfdcdd8f42486e0
6
+ metadata.gz: 9466dbbbe739c45d58c89c0368ac24eff9f888d479acddbee1e9a7fd434f80432f58e5a88b0a742fe7e877fd683e501ae2ad3a7be6843c152d75a033fc703cb7
7
+ data.tar.gz: 1e51e366e6cf36eaaae37f6db7980cc9f52df9465f2e569ced88a6b3bc095bd5ed616c2e34d80aafe114f1f1b3b115c424844c8280f4f5c7d55f377ecc1cf521
@@ -30,7 +30,7 @@ app (projectName, function(task)
30
30
  task.setIdentifier("<%= bundle_identifier %>");
31
31
  task.setVersion("<%= bundle_version %>");
32
32
  task.setAuthor("<%= bundle_company_name %>");
33
- task.setEmail("<%= bundle_email %>");
33
+ task.setEmail("<%= bundle_author_email %>");
34
34
  task.setSummary("<%= bundle_name %>");
35
35
  task.setSources(new FileList("**/*.j").exclude(FILE.join("Build", "**")).exclude(FILE.join("Frameworks", "Source", "**")));
36
36
  task.setResources(new FileList("Resources/**"));
@@ -0,0 +1,31 @@
1
+ @import <Foundation/Foundation.j>
2
+ @import <AppKit/AppKit.j>
3
+
4
+ @implementation AppController : CPObject
5
+ {
6
+ }
7
+
8
+ - (void)applicationDidFinishLaunching:(CPNotification)aNotification
9
+ {
10
+ var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
11
+ contentView = [theWindow contentView];
12
+
13
+ var label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
14
+
15
+ [label setStringValue:@"Hello World!"];
16
+ [label setFont:[CPFont boldSystemFontOfSize:24.0]];
17
+
18
+ [label sizeToFit];
19
+
20
+ [label setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
21
+ [label setCenter:[contentView center]];
22
+
23
+ [contentView addSubview:label];
24
+
25
+ [theWindow orderFront:self];
26
+
27
+ // Uncomment the following line to turn on the standard menu bar.
28
+ [CPMenu setMenuBarVisible:YES];
29
+ }
30
+
31
+ @end
@@ -0,0 +1,7 @@
1
+ name "YourApplicationName"
2
+ version "0.0.1"
3
+ author "YourName"
4
+ author_email "your_name@example.com"
5
+ company_name "YourCompany"
6
+ identifier "com.yourcompany.app"
7
+ created_at DateTime.new(2017,4,23)
@@ -0,0 +1,9 @@
1
+ @import <Foundation/Foundation.j>
2
+ @import <AppKit/AppKit.j>
3
+
4
+ @import "AppController.j"
5
+
6
+ function main(args, namedArgs)
7
+ {
8
+ CPApplicationMain(args, namedArgs);
9
+ }
data/exe/chino CHANGED
@@ -2,25 +2,54 @@
2
2
 
3
3
  require "chino"
4
4
  require "active_support/all"
5
+ require "fileutils"
5
6
 
6
7
  include Chino
7
8
 
8
9
  command = ARGV.shift
9
10
 
10
- if !File.exists? "Chinofile"
11
- puts "This directory has no Chinofile. Please create one before running chino"
12
- exit(1)
13
- end
11
+ def config
12
+ if !File.exists? "Chinofile"
13
+ puts "This directory has no Chinofile. Please create one before running chino"
14
+ exit(1)
15
+ end
14
16
 
15
- config = Config.new() do
16
- proc = Proc.new {}
17
- eval File.read("Chinofile"), proc.binding, "Chinofile"
17
+ Config.new()
18
18
  end
19
19
 
20
20
  if command == "build"
21
21
 
22
+ FileUtils.rm_r("build") if Dir.exists?("build")
23
+ FileUtils.rm_r("temp") if Dir.exists?("temp")
24
+ FileUtils.mkdir("temp")
25
+ FileUtils.cp_r("#{config.data_path}/common/Frameworks", "temp")
26
+ FileUtils.cp_r("Resources", "temp") if Dir.exists?("Resources")
27
+ Dir["./**/*.j"].each {|file| FileUtils.cp(file, "temp")}
28
+ Dir["#{config.data_path}/common/*"].select{|x|File.file? x}.each do |file|
29
+ filename = File.basename(file, ".erb")
30
+ file_content = config.get_file(filename)[:string]
31
+ File.write("temp/#{filename}", file_content)
32
+ end
33
+ IO.popen('cd temp && jake deploy') do |io|
34
+ while (line = io.gets) do
35
+ puts line
36
+ end
37
+ end
38
+ FileUtils.mv("temp/Build/Deployment/#{config.bundle_name}", "build")
39
+
40
+ elsif command == "create"
41
+
42
+ folder = ARGV.shift
43
+ if folder
44
+ FileUtils.cp_r "#{Gem.loaded_specs['chino'].full_gem_path}/data/chino/skeleton", folder
45
+ FileUtils.mkdir "#{folder}/Resources"
46
+ else
47
+ puts "No folder specified"
48
+ end
49
+
22
50
  elsif command == "gen"
23
51
  class_type = ARGV.shift
52
+
24
53
  if File.exists?("#{config.data_path}/templates/#{class_type}.j.erb")
25
54
  cls_name = ARGV.shift.camelize
26
55
  renderer = ERB.new(File.read("#{config.data_path}/templates/#{class_type}.j.erb"))
@@ -5,7 +5,9 @@ module Chino
5
5
  attr_accessor :information
6
6
 
7
7
  def initialize(&block)
8
- @information = {}
8
+ @information = {
9
+ dependencies: []
10
+ }
9
11
  instance_eval(&block)
10
12
 
11
13
  @information[:name] ||= "UnnamedChinoProject"
@@ -13,7 +15,7 @@ module Chino
13
15
  @information[:author] ||= "Incognito"
14
16
  @information[:author_email] ||= "incognito@example.com"
15
17
  @information[:company_name] ||= "#{@information[:author]}"
16
- @information[:identifier] ||= "com.#{@information[:company_name].downcase.gsub(/[^a-z0-9]+/, "_")}.#{@information[:name]}"
18
+ @information[:identifier] ||= "com.#{@information[:company_name].downcase.gsub(/[^a-z0-9]+/, "_")}.#{@information[:name].gsub(/[^a-z0-9]+/, "_")}"
17
19
  @information[:created_at] ||= Time.now
18
20
 
19
21
  end
@@ -45,5 +47,8 @@ module Chino
45
47
  def created_at(value)
46
48
  @information[:created_at] = value
47
49
  end
50
+
51
+ def imports(name, version:nil, path:nil)
52
+ end
48
53
  end
49
54
  end
data/lib/chino/config.rb CHANGED
@@ -3,8 +3,11 @@ require 'erb'
3
3
  module Chino
4
4
  class Config
5
5
 
6
- def initialize(&block)
7
- @chinofile = Chinofile.new(&block)
6
+ def initialize(file: "Chinofile")
7
+ @chinofile = Chinofile.new() do
8
+ proc = Proc.new {}
9
+ eval File.read(file), proc.binding, file
10
+ end
8
11
  end
9
12
 
10
13
  def bundle_name
data/lib/chino/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chino
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
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.2
4
+ version: 0.1.3
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-26 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -2565,6 +2565,9 @@ files:
2565
2565
  - data/chino/common/Jakefile.erb
2566
2566
  - data/chino/common/index-debug.html.erb
2567
2567
  - data/chino/common/index.html.erb
2568
+ - data/chino/skeleton/AppController.j
2569
+ - data/chino/skeleton/Chinofile
2570
+ - data/chino/skeleton/main.j
2568
2571
  - data/chino/templates/class.j.erb
2569
2572
  - exe/chino
2570
2573
  - lib/chino.rb
@@ -2593,7 +2596,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2593
2596
  version: '0'
2594
2597
  requirements: []
2595
2598
  rubyforge_project:
2596
- rubygems_version: 2.6.11
2599
+ rubygems_version: 2.4.8
2597
2600
  signing_key:
2598
2601
  specification_version: 4
2599
2602
  summary: Cappuccino application development tool