ObjCGenerator 0.0.4 → 0.0.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: c359c27e87442b2ffc7da956fce1be4f153016d2
4
- data.tar.gz: 6578fafc4cbd591a7222e6f5afefb863142eaf9e
3
+ metadata.gz: 6bda9cfd347531a805f73ddab559605a3d8cdc11
4
+ data.tar.gz: cb6bc9885cc2016f8a75266ff18406b207e8bf4b
5
5
  SHA512:
6
- metadata.gz: 4881b3b395116a29d08f411a3616cb849d4c7bea04d83c0f496b09966b697b6fca5105960d45068b7937f3683f041799318a0686ea79f7621aa58e92974169e0
7
- data.tar.gz: 53f181dfc16d4783a2a4b4ccc5ed5fa93f0c5cc38dc181f9ee38200ba6f082eb256279dfefa4ea511ceaeda64543bad56860773bd4bbee11611eb59eea35a990
6
+ metadata.gz: 1b6c58d00ac110f5bf98e411f6b51b0ca42c6727e84be93371e02d23f4675c5b4c87b905cf84d95ce2d05a28c75476c8bdcb525c67320b0fb6b20b0ce540cdce
7
+ data.tar.gz: 57626ddd58af53a87bf6ac7cd95264ab4102fe9135bf7319cb7d7914f36ecd029ce3da3aef3d445620a8458f0c648c305a569297e555e1b53101bfd8dae95aaf
data/bin/objcgenerator CHANGED
@@ -7,13 +7,13 @@ require 'rubygems'
7
7
  require 'commander/import'
8
8
 
9
9
  program :version, ObjCGenerator::VERSION
10
- program :description, 'Generate Objective-C code from a JSON description of classes.'
10
+ program :description, 'Generate Objective-C code from a JSON description of classes. For further help, type objgenerator <command> --help'
11
11
 
12
12
  command :generate do |c|
13
13
  c.syntax = 'objgenerator generate [options]'
14
- c.summary = ''
15
- c.description = ''
16
- c.example 'description', 'command example'
14
+ c.summary = 'Generate the Objective-C code'
15
+ c.description = 'Generate the Objective-C code. Provide a valid json description with the --input <string> parameter.'
16
+ c.example 'Use the "api.json" definition file and generate the classes in the current directory', 'objcgenerator generate --input "api.json" --output .'
17
17
  c.option '--input STRING', String, 'The path oth the JSON desctription'
18
18
  c.option '--output STRING', String, 'The output path where the obj-c code will be generated'
19
19
 
@@ -32,3 +32,51 @@ command :generate do |c|
32
32
  end
33
33
  end
34
34
  end
35
+
36
+ command :sample do |c|
37
+ c.syntax = 'objgenerator sample'
38
+ c.summary = 'Generate a sample json classes description to the standard outout'
39
+ c.description = 'Generate a sample json file that describes some test classes. Usefull to learn the syntax of the json file.'
40
+ c.example 'Generate a sample file', 'objcgenerator sample --output .'
41
+
42
+ c.action do |args, options|
43
+ options.default :output => '.'
44
+
45
+
46
+ json = [{
47
+ name: "SampleClass2",
48
+ type: "Class",
49
+ vars: [ { name: "someStr",
50
+ type: "String"
51
+ }]
52
+ },
53
+ {
54
+ name: "SampleClass",
55
+ type: "Class",
56
+ vars: [ {
57
+ name: "someBool",
58
+ type: "Bool"},
59
+ {
60
+ name: "someInt",
61
+ type: "Int"},
62
+ {
63
+ name: "someFloat",
64
+ type: "Float"},
65
+ {
66
+ name: "someStr",
67
+ type: "String"},
68
+ {
69
+ name: "someDate",
70
+ type: "Date"},
71
+ {
72
+ name: "someClass2",
73
+ type: "SampleClass2"},
74
+ {
75
+ name: "someStringArray",
76
+ type: "Array",
77
+ subType: "String"}
78
+ ]
79
+ }]
80
+ puts JSON.pretty_generate(json)
81
+ end
82
+ end
data/lib/ObjCGenerator.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "json"
2
- require "thor"
3
2
  require 'erb'
4
3
 
5
4
  require "ObjCGenerator/version"
@@ -1,3 +1,3 @@
1
1
  module ObjCGenerator
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ObjCGenerator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignazio Calò
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: commander
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 4.3.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 4.3.4
55
55
  description:
56
56
  email:
57
57
  - ignazioc@gmail.com
@@ -90,5 +90,6 @@ rubyforge_project:
90
90
  rubygems_version: 2.4.6
91
91
  signing_key:
92
92
  specification_version: 4
93
- summary: This ruby script generates Objective-C code based on a json description
93
+ summary: This ruby script generates Objective-C code based on a json description,
94
+ please read the readme on https://github.com/ignazioc/ObjCGenerator
94
95
  test_files: []