hemera 0.3.0 → 0.3.1
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 +4 -4
- data/Gemfile.lock +102 -0
- data/README.md +2 -1
- data/lib/hemera/command/xcode.rb +2 -2
- data/lib/hemera/source/meta/image/image_generator.rb +4 -11
- data/lib/hemera/source/meta/image/objc.rb +19 -0
- data/lib/hemera/version.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c84a55447ed85f7b166066da2d7ec387497fcaf535b528a320da75f0b96ee68
|
|
4
|
+
data.tar.gz: d29df84b0a7fe84fb3835976353da3e6ddafbd4656b6494aac76ee627255d5d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3650ef1bed4bb18a3949f4be969e2847afcf0633ad55bdb7d10fd50546477dafa0498bed3fc39bac4f09fa67803565e6fe0e291a04bbb39a81711e6c64910497
|
|
7
|
+
data.tar.gz: 44f752cdd7adcbe3ebe7ddf8939626ab4870d2a4f4e6b8f0bead09b0e9b1faee46a8bd0d72a186dd17921d56b1dc6652a8f13b218a6f8f8830a182afff713944
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
hemera (0.3.1)
|
|
5
|
+
gli (~> 2.18)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
CFPropertyList (3.0.0)
|
|
11
|
+
activesupport (4.2.10)
|
|
12
|
+
i18n (~> 0.7)
|
|
13
|
+
minitest (~> 5.1)
|
|
14
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
|
15
|
+
tzinfo (~> 1.1)
|
|
16
|
+
atomos (0.1.3)
|
|
17
|
+
claide (1.0.2)
|
|
18
|
+
cocoapods (1.5.3)
|
|
19
|
+
activesupport (>= 4.0.2, < 5)
|
|
20
|
+
claide (>= 1.0.2, < 2.0)
|
|
21
|
+
cocoapods-core (= 1.5.3)
|
|
22
|
+
cocoapods-deintegrate (>= 1.0.2, < 2.0)
|
|
23
|
+
cocoapods-downloader (>= 1.2.0, < 2.0)
|
|
24
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
25
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
|
26
|
+
cocoapods-stats (>= 1.0.0, < 2.0)
|
|
27
|
+
cocoapods-trunk (>= 1.3.0, < 2.0)
|
|
28
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
|
29
|
+
colored2 (~> 3.1)
|
|
30
|
+
escape (~> 0.0.4)
|
|
31
|
+
fourflusher (~> 2.0.1)
|
|
32
|
+
gh_inspector (~> 1.0)
|
|
33
|
+
molinillo (~> 0.6.5)
|
|
34
|
+
nap (~> 1.0)
|
|
35
|
+
ruby-macho (~> 1.1)
|
|
36
|
+
xcodeproj (>= 1.5.7, < 2.0)
|
|
37
|
+
cocoapods-core (1.5.3)
|
|
38
|
+
activesupport (>= 4.0.2, < 6)
|
|
39
|
+
fuzzy_match (~> 2.0.4)
|
|
40
|
+
nap (~> 1.0)
|
|
41
|
+
cocoapods-deintegrate (1.0.2)
|
|
42
|
+
cocoapods-downloader (1.2.2)
|
|
43
|
+
cocoapods-plugins (1.0.0)
|
|
44
|
+
nap
|
|
45
|
+
cocoapods-search (1.0.0)
|
|
46
|
+
cocoapods-stats (1.0.0)
|
|
47
|
+
cocoapods-trunk (1.3.1)
|
|
48
|
+
nap (>= 0.8, < 2.0)
|
|
49
|
+
netrc (~> 0.11)
|
|
50
|
+
cocoapods-try (1.1.0)
|
|
51
|
+
colored2 (3.1.2)
|
|
52
|
+
concurrent-ruby (1.0.5)
|
|
53
|
+
diff-lcs (1.3)
|
|
54
|
+
escape (0.0.4)
|
|
55
|
+
fourflusher (2.0.1)
|
|
56
|
+
fuzzy_match (2.0.4)
|
|
57
|
+
gh_inspector (1.1.3)
|
|
58
|
+
gli (2.18.0)
|
|
59
|
+
i18n (0.9.5)
|
|
60
|
+
concurrent-ruby (~> 1.0)
|
|
61
|
+
minitest (5.11.3)
|
|
62
|
+
molinillo (0.6.6)
|
|
63
|
+
nanaimo (0.2.6)
|
|
64
|
+
nap (1.1.0)
|
|
65
|
+
netrc (0.11.0)
|
|
66
|
+
rake (10.5.0)
|
|
67
|
+
rspec (3.8.0)
|
|
68
|
+
rspec-core (~> 3.8.0)
|
|
69
|
+
rspec-expectations (~> 3.8.0)
|
|
70
|
+
rspec-mocks (~> 3.8.0)
|
|
71
|
+
rspec-core (3.8.0)
|
|
72
|
+
rspec-support (~> 3.8.0)
|
|
73
|
+
rspec-expectations (3.8.2)
|
|
74
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
75
|
+
rspec-support (~> 3.8.0)
|
|
76
|
+
rspec-mocks (3.8.0)
|
|
77
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
78
|
+
rspec-support (~> 3.8.0)
|
|
79
|
+
rspec-support (3.8.0)
|
|
80
|
+
ruby-macho (1.3.1)
|
|
81
|
+
thread_safe (0.3.6)
|
|
82
|
+
tzinfo (1.2.5)
|
|
83
|
+
thread_safe (~> 0.1)
|
|
84
|
+
xcodeproj (1.7.0)
|
|
85
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
|
86
|
+
atomos (~> 0.1.3)
|
|
87
|
+
claide (>= 1.0.2, < 2.0)
|
|
88
|
+
colored2 (~> 3.1)
|
|
89
|
+
nanaimo (~> 0.2.6)
|
|
90
|
+
|
|
91
|
+
PLATFORMS
|
|
92
|
+
ruby
|
|
93
|
+
|
|
94
|
+
DEPENDENCIES
|
|
95
|
+
bundler (~> 1.16)
|
|
96
|
+
cocoapods (~> 1.5, >= 1.5.0)
|
|
97
|
+
hemera!
|
|
98
|
+
rake (~> 10.0)
|
|
99
|
+
rspec (~> 3.0)
|
|
100
|
+
|
|
101
|
+
BUNDLED WITH
|
|
102
|
+
1.17.1
|
data/README.md
CHANGED
|
@@ -37,6 +37,7 @@ COMMANDS
|
|
|
37
37
|
xcode, x - Xcode
|
|
38
38
|
```
|
|
39
39
|
use meta to generate code
|
|
40
|
+
Swift code will be generated by default, if you want objective-c, use -o like `hm meta image -o fileName`
|
|
40
41
|
```
|
|
41
42
|
hm meta
|
|
42
43
|
|
|
@@ -44,7 +45,7 @@ NAME
|
|
|
44
45
|
meta - metaprogramming
|
|
45
46
|
|
|
46
47
|
SYNOPSIS
|
|
47
|
-
hm meta img <fileName> <path>
|
|
48
|
+
hm meta img <fileName> <path>
|
|
48
49
|
|
|
49
50
|
COMMANDS
|
|
50
51
|
img, i - generate img code
|
data/lib/hemera/command/xcode.rb
CHANGED
|
@@ -4,8 +4,8 @@ desc 'Xcode'
|
|
|
4
4
|
command :xcode, :x do |c|
|
|
5
5
|
c.desc 'Open Xcode Workspace'
|
|
6
6
|
c.command :o, :open do |com|
|
|
7
|
-
com.action do |_global_options, _options,
|
|
8
|
-
Hemera::Xcode.open '.'
|
|
7
|
+
com.action do |_global_options, _options, args|
|
|
8
|
+
Hemera::Xcode.open args.first || '.'
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require 'erb'
|
|
2
1
|
require_relative 'swift'
|
|
2
|
+
require_relative 'objc'
|
|
3
3
|
module Hemera
|
|
4
4
|
module Generator
|
|
5
5
|
class ImageModel
|
|
@@ -51,14 +51,6 @@ module Hemera
|
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
def interface_file
|
|
55
|
-
ERB.new(File.read(File.expand_path('template/image.h.erb', __dir__))).result(binding)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def implementent_file
|
|
59
|
-
ERB.new(File.read(File.expand_path('template/image.m.erb', __dir__))).result(binding)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
54
|
def generate(is_swift = true)
|
|
63
55
|
puts 'generating 😊'
|
|
64
56
|
if is_swift
|
|
@@ -71,12 +63,13 @@ module Hemera
|
|
|
71
63
|
interface_file_path = @path + '/' + @class_name + '.h'
|
|
72
64
|
implementent_file_path = @path + '/' + @class_name + '.m'
|
|
73
65
|
puts " #{interface_file_path} and #{implementent_file_path} generating!"
|
|
66
|
+
objc_image_generator = ObjCImageGenerator.new(@class_name, @images)
|
|
74
67
|
File.open(interface_file_path, 'w') do |f|
|
|
75
|
-
f.puts interface_file
|
|
68
|
+
f.puts objc_image_generator.interface_file
|
|
76
69
|
end
|
|
77
70
|
|
|
78
71
|
File.open(implementent_file_path, 'w') do |f|
|
|
79
|
-
f.puts implementent_file
|
|
72
|
+
f.puts objc_image_generator.implementent_file
|
|
80
73
|
end
|
|
81
74
|
end
|
|
82
75
|
puts 'generating done! 🎉'
|
|
@@ -1 +1,20 @@
|
|
|
1
|
+
require 'erb'
|
|
2
|
+
module Hemera
|
|
3
|
+
module Generator
|
|
4
|
+
class ObjCImageGenerator
|
|
5
|
+
def initialize(class_name, images)
|
|
6
|
+
@class_name = class_name
|
|
7
|
+
@images = images
|
|
8
|
+
end
|
|
1
9
|
|
|
10
|
+
def interface_file
|
|
11
|
+
ERB.new(File.read(File.expand_path('template/image.h.erb', __dir__))).result(binding)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def implementent_file
|
|
15
|
+
ERB.new(File.read(File.expand_path('template/image.m.erb', __dir__))).result(binding)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/hemera/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hemera
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- JianweiWangs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-11-
|
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -28,22 +28,22 @@ dependencies:
|
|
|
28
28
|
name: cocoapods
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "~>"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '1.5'
|
|
34
31
|
- - ">="
|
|
35
32
|
- !ruby/object:Gem::Version
|
|
36
33
|
version: 1.5.0
|
|
34
|
+
- - "~>"
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '1.5'
|
|
37
37
|
type: :development
|
|
38
38
|
prerelease: false
|
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
40
40
|
requirements:
|
|
41
|
-
- - "~>"
|
|
42
|
-
- !ruby/object:Gem::Version
|
|
43
|
-
version: '1.5'
|
|
44
41
|
- - ">="
|
|
45
42
|
- !ruby/object:Gem::Version
|
|
46
43
|
version: 1.5.0
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '1.5'
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: rake
|
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -98,6 +98,7 @@ files:
|
|
|
98
98
|
- ".travis.yml"
|
|
99
99
|
- CODE_OF_CONDUCT.md
|
|
100
100
|
- Gemfile
|
|
101
|
+
- Gemfile.lock
|
|
101
102
|
- LICENSE.txt
|
|
102
103
|
- README.md
|
|
103
104
|
- Rakefile
|
|
@@ -141,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
141
142
|
version: '0'
|
|
142
143
|
requirements: []
|
|
143
144
|
rubyforge_project:
|
|
144
|
-
rubygems_version: 2.7.
|
|
145
|
+
rubygems_version: 2.7.8
|
|
145
146
|
signing_key:
|
|
146
147
|
specification_version: 4
|
|
147
148
|
summary: development tool
|