generamba 0.7.4 → 0.7.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: 5382f3daaa79b49658dadd60155a036352984dce
4
- data.tar.gz: f27992a72f3ffda44ab213cec784c87a262f4732
3
+ metadata.gz: 42e0536cf5d817ae13ea91bae5486c78bf904105
4
+ data.tar.gz: 968e719a76cdf580d9e0a7e9778cec1632c5ce45
5
5
  SHA512:
6
- metadata.gz: dfe52b2b9ebe991851955d30dd3ead8604927f7162742afede6142816a1f44a02c424f5cea3245e6e1346c983084fca48818166447f2e7d8e5c2853649b29082
7
- data.tar.gz: 098b52bdc639a2e86ecb79797574ec1d42d4f1809b17e849bf86e0eb2208f9a0e7908adb1b77a20aef231b4742fdde73ce6c3a5305ba9c31a1d0b33d349c4d14
6
+ metadata.gz: c05b963e09b56a990cf53f6a1cd913207755a49f8dae728d2a993034c1f917b7ea1463d6cab24d81eeed0082a730970c7c7aeae49a00cffca9bfd4fdad994dfa
7
+ data.tar.gz: 24a00a2acaaa7f1d69d6f4b64e6321b7bb7b63871083286cc3b86ce0f821bce15f72288d4020b44fd69b103fa5a2a0d5aa6696739c0610239f53287f8b3771bb
data/.gitignore CHANGED
@@ -4,3 +4,5 @@
4
4
  .idea/modules.xml
5
5
  .idea/vcs.xml
6
6
  .idea/workspace.xml
7
+ .rakeTasks
8
+ encodings.xml
data/CHANGELOG.md CHANGED
@@ -1,23 +1,20 @@
1
1
  # Change Log
2
2
 
3
- ## [Unreleased](https://github.com/rambler-ios/Generamba/tree/HEAD)
4
-
5
- [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.7.3...HEAD)
3
+ ## [0.7.4](https://github.com/rambler-ios/Generamba/tree/0.7.4) (2016-02-21)
4
+ [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.7.3...0.7.4)
6
5
 
7
6
  **Implemented enhancements:**
8
7
 
9
8
  - Asks the user if he needed tests in `generamba setup` command [\#85](https://github.com/rambler-ios/Generamba/issues/85)
10
- - Improve the visualization of commands with parameters [\#69](https://github.com/rambler-ios/Generamba/issues/69)
9
+ - Can we introduce something similar to view partials in rails \(for duplicated parts of views\) [\#62](https://github.com/rambler-ios/Generamba/issues/62)
11
10
 
12
11
  **Fixed bugs:**
13
12
 
14
13
  - Add resources\(xib, storyboard and etc\) in project bundle resources. [\#84](https://github.com/rambler-ios/Generamba/issues/84)
15
14
 
16
- **Merged pull requests:**
15
+ **Closed issues:**
17
16
 
18
- - Print table with summary info about input parameters [\#89](https://github.com/rambler-ios/Generamba/pull/89) ([Beniamiiin](https://github.com/Beniamiiin))
19
- - Handle any resources in template and correct add to project [\#88](https://github.com/rambler-ios/Generamba/pull/88) ([Beniamiiin](https://github.com/Beniamiiin))
20
- - Implemented new question, about need tests in `generamba setup` [\#87](https://github.com/rambler-ios/Generamba/pull/87) ([Beniamiiin](https://github.com/Beniamiiin))
17
+ - Get "Liquid error: This liquid context does not allow includes." on all files in just generated module [\#93](https://github.com/rambler-ios/Generamba/issues/93)
21
18
 
22
19
  ## [0.7.3](https://github.com/rambler-ios/Generamba/tree/0.7.3) (2016-01-24)
23
20
  [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.7.2...0.7.3)
@@ -27,17 +24,12 @@
27
24
  - Enhance `generamba template search` to search templates in custom catalogs [\#75](https://github.com/rambler-ios/Generamba/issues/75)
28
25
  - Enhance `generamba template list` to browse custom catalogs [\#74](https://github.com/rambler-ios/Generamba/issues/74)
29
26
  - Warn the user if template contains missing dependencies [\#17](https://github.com/rambler-ios/Generamba/issues/17)
30
- - Added method to check missing template dependencies in podfile [\#79](https://github.com/rambler-ios/Generamba/pull/79) ([Beniamiiin](https://github.com/Beniamiiin))
31
27
 
32
28
  **Closed issues:**
33
29
 
34
30
  - Can we use constants from rambafile in templates? [\#81](https://github.com/rambler-ios/Generamba/issues/81)
35
31
  - Arguments for `generamba gen Name modulename` [\#80](https://github.com/rambler-ios/Generamba/issues/80)
36
32
 
37
- **Merged pull requests:**
38
-
39
- - Fixed crash when templates directory exists. [\#78](https://github.com/rambler-ios/Generamba/pull/78) ([mogol](https://github.com/mogol))
40
-
41
33
  ## [0.7.2](https://github.com/rambler-ios/Generamba/tree/0.7.2) (2016-01-10)
42
34
  [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.7.1...0.7.2)
43
35
 
@@ -50,25 +42,15 @@
50
42
  **Fixed bugs:**
51
43
 
52
44
  - Don't set target in swift projects [\#65](https://github.com/rambler-ios/Generamba/issues/65)
53
- - Errors if default path is empty [\#64](https://github.com/rambler-ios/Generamba/issues/64)
54
- - Default template set can not be used [\#60](https://github.com/rambler-ios/Generamba/issues/60)
55
45
  - Incorrect behavior when generate module which already exists [\#52](https://github.com/rambler-ios/Generamba/issues/52)
56
46
 
57
47
  **Closed issues:**
58
48
 
59
49
  - Can generamba be used to generate swift modules? [\#61](https://github.com/rambler-ios/Generamba/issues/61)
60
50
  - Git 1.2.9.1 [\#57](https://github.com/rambler-ios/Generamba/issues/57)
61
-
62
- **Merged pull requests:**
63
-
64
- - Feature/custom catalogs [\#73](https://github.com/rambler-ios/Generamba/pull/73) ([etolstoy](https://github.com/etolstoy))
65
- - Added `generamba version` command [\#67](https://github.com/rambler-ios/Generamba/pull/67) ([etolstoy](https://github.com/etolstoy))
66
- - Fixed \#64: Errors if default path is empty [\#66](https://github.com/rambler-ios/Generamba/pull/66) ([Beniamiiin](https://github.com/Beniamiiin))
67
- - Added error display, if not specify at least one template in Rambafile \#60 [\#63](https://github.com/rambler-ios/Generamba/pull/63) ([Beniamiiin](https://github.com/Beniamiiin))
68
- - Fixed \#52 - Incorrect behavior when generate module which already exists [\#59](https://github.com/rambler-ios/Generamba/pull/59) ([Beniamiiin](https://github.com/Beniamiiin))
69
- - docs, link to Rambafile when it mentioned [\#58](https://github.com/rambler-ios/Generamba/pull/58) ([MaksimBazarov](https://github.com/MaksimBazarov))
70
- - Fixed incorrect group path [\#56](https://github.com/rambler-ios/Generamba/pull/56) ([Beniamiiin](https://github.com/Beniamiiin))
71
- - Docs translated to english \(\#13\) [\#55](https://github.com/rambler-ios/Generamba/pull/55) ([novixon](https://github.com/novixon))
51
+ - Clarify generamba parameters usage [\#51](https://github.com/rambler-ios/Generamba/issues/51)
52
+ - Add documentation for liquid templates [\#48](https://github.com/rambler-ios/Generamba/issues/48)
53
+ - The documentation is not translated into English [\#13](https://github.com/rambler-ios/Generamba/issues/13)
72
54
 
73
55
  ## [0.7.1](https://github.com/rambler-ios/Generamba/tree/0.7.1) (2015-12-20)
74
56
  [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.7.0...0.7.1)
@@ -86,10 +68,6 @@
86
68
 
87
69
  - Add support for multiple targets during generamba setup [\#49](https://github.com/rambler-ios/Generamba/issues/49)
88
70
 
89
- **Merged pull requests:**
90
-
91
- - Feature/settingslogic remove [\#47](https://github.com/rambler-ios/Generamba/pull/47) ([etolstoy](https://github.com/etolstoy))
92
-
93
71
  ## [0.7.0](https://github.com/rambler-ios/Generamba/tree/0.7.0) (2015-12-13)
94
72
  [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.6.2...0.7.0)
95
73
 
@@ -107,28 +85,17 @@
107
85
  - Non-informative error message when running `generamba template install` in the wrong directory [\#39](https://github.com/rambler-ios/Generamba/issues/39)
108
86
  - undefined method `each' for nil:NilClass \(NoMethodError\) [\#37](https://github.com/rambler-ios/Generamba/issues/37)
109
87
 
110
- **Merged pull requests:**
111
-
112
- - Feature/multiple targets [\#43](https://github.com/rambler-ios/Generamba/pull/43) ([etolstoy](https://github.com/etolstoy))
113
- - Feature/colored output [\#40](https://github.com/rambler-ios/Generamba/pull/40) ([etolstoy](https://github.com/etolstoy))
114
- - Feature/gen file flags [\#38](https://github.com/rambler-ios/Generamba/pull/38) ([etolstoy](https://github.com/etolstoy))
115
-
116
88
  ## [0.6.2](https://github.com/rambler-ios/Generamba/tree/0.6.2) (2015-11-25)
117
89
  [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.6.1...0.6.2)
118
90
 
119
91
  **Fixed bugs:**
120
92
 
121
93
  - Can't install template from git repo [\#36](https://github.com/rambler-ios/Generamba/issues/36)
122
- - Can't find template by local fullpath [\#35](https://github.com/rambler-ios/Generamba/issues/35)
123
94
 
124
95
  **Closed issues:**
125
96
 
126
97
  - Need more information about dependencies [\#34](https://github.com/rambler-ios/Generamba/issues/34)
127
98
 
128
- **Merged pull requests:**
129
-
130
- - Mention the Ruby 2.2+ requirement in README [\#33](https://github.com/rambler-ios/Generamba/pull/33) ([rodionovd](https://github.com/rodionovd))
131
-
132
99
  ## [0.6.1](https://github.com/rambler-ios/Generamba/tree/0.6.1) (2015-11-21)
133
100
  [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.6.0...0.6.1)
134
101
 
@@ -142,6 +109,11 @@
142
109
  - Sometimes Generamba fills in the wrong test target in the Rambafile [\#30](https://github.com/rambler-ios/Generamba/issues/30)
143
110
  - Seems that Generamba doesn't add project name to the headers [\#29](https://github.com/rambler-ios/Generamba/issues/29)
144
111
 
112
+ **Closed issues:**
113
+
114
+ - Add a documentation for a .rambaspec file and overall template structure [\#24](https://github.com/rambler-ios/Generamba/issues/24)
115
+ - Rambafile format is not documented [\#9](https://github.com/rambler-ios/Generamba/issues/9)
116
+
145
117
  ## [0.6.0](https://github.com/rambler-ios/Generamba/tree/0.6.0) (2015-11-15)
146
118
  [Full Changelog](https://github.com/rambler-ios/Generamba/compare/0.5.0...0.6.0)
147
119
 
@@ -152,24 +124,12 @@
152
124
  - Move the hardcoded keys to the constants [\#15](https://github.com/rambler-ios/Generamba/issues/15)
153
125
  - Implement automatic template creation [\#8](https://github.com/rambler-ios/Generamba/issues/8)
154
126
  - Change some of the questions of `generamba setup` [\#7](https://github.com/rambler-ios/Generamba/issues/7)
155
- - Implement installation of templates from the remote git repository [\#6](https://github.com/rambler-ios/Generamba/issues/6)
156
- - Implement installation of templates with local filepath [\#5](https://github.com/rambler-ios/Generamba/issues/5)
157
- - Remove the author-specific information from Rambafile [\#1](https://github.com/rambler-ios/Generamba/issues/1)
158
127
 
159
128
  **Fixed bugs:**
160
129
 
161
130
  - Rambafile uses absolute filepath to xcodeproj file [\#21](https://github.com/rambler-ios/Generamba/issues/21)
162
131
  - Duplicate file reference in project.pbxproj [\#20](https://github.com/rambler-ios/Generamba/issues/20)
163
132
  - Move the rambler\_viper\_controller template to the generamba-catalog [\#16](https://github.com/rambler-ios/Generamba/issues/16)
164
- - The output of `setup` command is splitted sometimes [\#4](https://github.com/rambler-ios/Generamba/issues/4)
165
- - Files are generated with incorrect filepaths [\#3](https://github.com/rambler-ios/Generamba/issues/3)
166
-
167
- **Merged pull requests:**
168
-
169
- - Feature/template creation [\#23](https://github.com/rambler-ios/Generamba/pull/23) ([etolstoy](https://github.com/etolstoy))
170
- - Added command: generamba template install [\#14](https://github.com/rambler-ios/Generamba/pull/14) ([etolstoy](https://github.com/etolstoy))
171
- - Feature/cli improvements [\#12](https://github.com/rambler-ios/Generamba/pull/12) ([AndreyZarembo](https://github.com/AndreyZarembo))
172
- - Master [\#2](https://github.com/rambler-ios/Generamba/pull/2) ([etolstoy](https://github.com/etolstoy))
173
133
 
174
134
  ## [0.5.0](https://github.com/rambler-ios/Generamba/tree/0.5.0) (2015-11-01)
175
135
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- generamba (0.7.3)
4
+ generamba (0.7.4)
5
5
  cocoapods-core (= 0.39.0)
6
6
  git (= 1.2.9.1)
7
7
  liquid (= 3.0.6)
@@ -12,7 +12,7 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (4.2.5.1)
15
+ activesupport (4.2.5)
16
16
  i18n (~> 0.7)
17
17
  json (~> 1.7, >= 1.7.7)
18
18
  minitest (~> 5.1)
@@ -32,7 +32,7 @@ GEM
32
32
  json (1.8.3)
33
33
  liquid (3.0.6)
34
34
  minitest (5.8.4)
35
- nap (1.1.0)
35
+ nap (1.0.0)
36
36
  rake (10.4.2)
37
37
  rspec (3.3.0)
38
38
  rspec-core (~> 3.3.0)
data/README.md CHANGED
@@ -5,6 +5,8 @@
5
5
 
6
6
  **Generamba** is a code generator made for working with Xcode. Primarily it is designed to generate VIPER modules but it is quite easy to customize it for generation of any other classes (both in Objective-C and Swift).
7
7
 
8
+ *We keep evolving Generamba:* [changelog](https://github.com/rambler-ios/Generamba/blob/develop/CHANGELOG.md), [release notes](https://github.com/rambler-ios/Generamba/releases).
9
+
8
10
  ![Generamba Screenshot](http://s24.postimg.org/gej9cg1cl/generamba.jpg)
9
11
 
10
12
  ### Key features
@@ -24,7 +26,7 @@ When necessary you can install the required Ruby version with the help of [`rvm`
24
26
 
25
27
  Run the command `gem install generamba`.
26
28
 
27
- ### Using
29
+ ### Usage
28
30
  1. Run [`generamba setup`](https://github.com/rambler-ios/Generamba/wiki/Available-Commands#basic-generamba-configuration) in the project root folder. This command helps to create [Rambafile](https://github.com/rambler-ios/Generamba/wiki/Rambafile-Structure) that define all configuration needed to generate code. You can modify this file directly in future.
29
31
  2. Add all templates planned to use in the project to the generated [Rambafile](https://github.com/rambler-ios/Generamba/wiki/Rambafile-Structure). You can begin with one of the templates from our catalog: `{name: 'rviper_controller'}`.
30
32
  3. Run [`generamba template install`](https://github.com/rambler-ios/Generamba/wiki/Available-Commands#template-installation). All the templates will be placed in the '/Templates' folder of your current project.
@@ -41,6 +43,7 @@ Run `generamba help` to learn more about each of the Generamba features.
41
43
 
42
44
  **Other materials:**
43
45
  - [Russian] Rambler.iOS V: Generamba and Code Generation ([Slides](http://www.slideshare.net/Rambler-iOS/viper-56423582) | [Video](http://www.youtube.com/watch?v=NXNiN9FaUnY))
46
+ - [Introduction to Generamba](http://etolstoy.com/2016/02/10/generamba/)
44
47
 
45
48
  ### Authors
46
49
 
data/generamba.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'generamba/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'generamba'
8
8
  spec.version = Generamba::VERSION
9
- spec.authors = ['Egor Tolstoy', 'Andrey Zarembo']
9
+ spec.authors = ['Egor Tolstoy', 'Andrey Zarembo', 'Beniamin Sarkisyan']
10
10
  spec.email = 'e.tolstoy@rambler-co.ru'
11
11
 
12
12
  spec.summary = 'Advanced code generator for Xcode projects with a nice and flexible template system.'
@@ -24,4 +24,5 @@ module Generamba
24
24
  TEMPLATE_DECLARATION_NAME_KEY = 'name'
25
25
  TEMPLATE_DECLARATION_LOCAL_KEY = 'local'
26
26
  TEMPLATE_DECLARATION_GIT_KEY = 'git'
27
+ TEMPLATE_DECLARATION_BRANCH_KEY = 'branch'
27
28
  end
@@ -13,7 +13,7 @@ module Generamba
13
13
  templates.push(param['name'])
14
14
  end
15
15
 
16
- params['templates'] = templates.join(', ')
16
+ params['templates'] = templates.join("\n")
17
17
 
18
18
  return params
19
19
  end
@@ -42,8 +42,7 @@ module Generamba
42
42
  # @return [Bool]
43
43
  def self.obtain_spec_path(template_name, template_path)
44
44
  spec_filename = template_name + RAMBASPEC_EXTENSION
45
- Pathname.new(template_path)
46
- .join(spec_filename)
45
+ Pathname.new(template_path).join(spec_filename)
47
46
  end
48
47
  end
49
48
  end
@@ -13,20 +13,27 @@ module Generamba
13
13
  puts("Installing #{template_name}...")
14
14
 
15
15
  repo_url = template_declaration.git
16
+ repo_branch = template_declaration.branch
16
17
 
17
18
  temp_path = Dir.tmpdir()
18
- template_dir = Pathname.new(temp_path)
19
- .join(template_name)
20
- Git.clone(repo_url, template_name, :path => temp_path)
19
+ template_dir = Pathname.new(temp_path).join(template_name)
20
+
21
+ if repo_branch != nil
22
+ Git.export(repo_url, template_name, :branch => repo_branch, :path => temp_path)
23
+ else
24
+ Git.clone(repo_url, template_name, :path => temp_path)
25
+ end
26
+
27
+ template_path = "#{template_dir}/#{template_name}"
21
28
 
22
- rambaspec_exist = Generamba::RambaspecValidator.validate_spec_existance(template_name, template_dir)
29
+ rambaspec_exist = Generamba::RambaspecValidator.validate_spec_existance(template_name, template_path)
23
30
  unless rambaspec_exist
24
31
  FileUtils.rm_rf(temp_path)
25
32
  error_description = "Cannot find #{template_name + RAMBASPEC_EXTENSION} in the root directory of specified repository.".red
26
33
  raise StandardError.new(error_description)
27
34
  end
28
35
 
29
- rambaspec_valid = Generamba::RambaspecValidator.validate_spec(template_name, template_dir)
36
+ rambaspec_valid = Generamba::RambaspecValidator.validate_spec(template_name, template_path)
30
37
  unless rambaspec_valid
31
38
  error_description = "#{template_name + RAMBASPEC_EXTENSION} is not valid.".red
32
39
  raise StandardError.new(error_description)
@@ -35,7 +42,7 @@ module Generamba
35
42
  install_path = Pathname.new(TEMPLATES_FOLDER)
36
43
  .join(template_name)
37
44
  FileUtils.mkdir_p install_path
38
- FileUtils.copy_entry(template_dir, install_path)
45
+ FileUtils.copy_entry(template_path, install_path)
39
46
 
40
47
  FileUtils.rm_rf(temp_path)
41
48
  end
@@ -15,12 +15,13 @@ module Generamba
15
15
  # Describes a Generamba template declaration model
16
16
  class TemplateDeclaration
17
17
 
18
- attr_reader :name, :local, :git, :type
18
+ attr_reader :name, :local, :git, :branch, :type
19
19
 
20
20
  def initialize(template_hash)
21
21
  @name = template_hash[TEMPLATE_DECLARATION_NAME_KEY]
22
22
  @local = template_hash[TEMPLATE_DECLARATION_LOCAL_KEY]
23
23
  @git = template_hash[TEMPLATE_DECLARATION_GIT_KEY]
24
+ @branch = template_hash[TEMPLATE_DECLARATION_BRANCH_KEY]
24
25
 
25
26
  @type = TemplateDeclarationType::LOCAL_TEMPLATE if @local
26
27
  @type = TemplateDeclarationType::REMOTE_TEMPLATE if @git
@@ -1,3 +1,3 @@
1
1
  module Generamba
2
- VERSION = '0.7.4'
2
+ VERSION = '0.7.5'
3
3
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generamba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Egor Tolstoy
8
8
  - Andrey Zarembo
9
+ - Beniamin Sarkisyan
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2016-02-21 00:00:00.000000000 Z
13
+ date: 2016-04-24 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: thor