appifier 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +56 -2
  3. data/Gemfile +3 -1
  4. data/Rakefile +27 -15
  5. data/VERSION +1 -1
  6. data/appifier.gemspec +20 -19
  7. data/bin/console +4 -3
  8. data/config/appifier.registry +9 -0
  9. data/config/settings.yml +59 -0
  10. data/exe/appifier +2 -1
  11. data/lib/appifier/actors/collector.rb +67 -0
  12. data/lib/appifier/actors/generator.rb +92 -100
  13. data/lib/appifier/actors/init.rb +3 -1
  14. data/lib/appifier/actors/retriever.rb +35 -35
  15. data/lib/appifier/cli/configuration.rb +13 -14
  16. data/lib/appifier/cli/templates.rb +28 -8
  17. data/lib/appifier/cli.rb +108 -49
  18. data/lib/appifier/components/Appifile.rb +35 -0
  19. data/lib/appifier/components/init.rb +3 -0
  20. data/lib/appifier/components/templates.rb +34 -0
  21. data/lib/appifier/helpers/archives.rb +29 -31
  22. data/lib/appifier/helpers/datasets.rb +36 -0
  23. data/lib/appifier/helpers/gem.rb +31 -30
  24. data/lib/appifier/helpers/init.rb +3 -1
  25. data/lib/appifier/helpers/user.rb +29 -31
  26. data/lib/appifier/services/finisher.rb +52 -0
  27. data/lib/appifier/services/init.rb +3 -0
  28. data/lib/appifier/setup.rb +11 -7
  29. data/lib/appifier/version.rb +2 -0
  30. data/lib/appifier.rb +34 -23
  31. data/samples/dummy/Appifile +12 -0
  32. data/samples/{skeleton → dummy/skeleton}/%%APPNAME.downcase%%/.rspec +0 -0
  33. data/samples/{skeleton → dummy/skeleton}/%%APPNAME.downcase%%/Rakefile +0 -0
  34. data/samples/{skeleton → dummy/skeleton}/%%APPNAME.downcase%%/config.ru +0 -0
  35. data/samples/{skeleton → dummy/skeleton}/%%APPNAME.downcase%%/exe/%%APPNAME.downcase%% +0 -0
  36. data/samples/{skeleton → dummy/skeleton}/%%APPNAME.downcase%%/lib/%%APPNAME.downcase%%.rb +0 -0
  37. data/samples/{skeleton → dummy/skeleton}/%%APPNAME.downcase%%/spec/%%APPNAME.downcase%%_spec.rb +0 -0
  38. data/samples/dummy.tgz +0 -0
  39. metadata +53 -30
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'version'
2
4
  module Appifier
3
5
  VERSION = Version.current
data/lib/appifier.rb CHANGED
@@ -1,50 +1,61 @@
1
- require "appifier/version"
2
- require 'appifier/helpers/init'
3
-
4
- include Appifier::Helpers::User
5
- include Appifier::Helpers::Gem
6
- include Appifier::Helpers::Archives
1
+ # frozen_string_literal: true
7
2
 
8
- require 'appifier/setup'
9
- require 'appifier/actors/init'
10
3
  require 'carioca'
11
-
12
4
  require 'thot'
13
5
  require 'fileutils'
14
6
  require 'etc'
15
7
 
16
8
  include Thot
17
9
 
10
+
11
+ require 'appifier/version'
12
+ require 'appifier/helpers/init'
13
+
18
14
  module Appifier
19
- DEFAULT_PATH = "~/.appifier"
15
+ DEFAULT_PATH = '~/.appifier'
20
16
  DEFAULT_TEMPLATES_PATH = "#{DEFAULT_PATH}/templates"
21
- DEFAULT_CONFIG_PATH = "#{DEFAULT_PATH}/settings.yml"
17
+ DEFAULT_CONFIG_PATH = "#{DEFAULT_PATH}/config/"
18
+ DEFAULT_LOGS_PATH = "#{DEFAULT_PATH}/logs"
19
+ DEFAULT_DATASETS_PATH = "#{DEFAULT_PATH}/datasets"
20
+ DEFAULT_LOG_FILENAME = "appifier.log"
21
+ DEFAULT_SETTINGS_FILENAME = "settings.yml"
22
+ DEFAULT_REGISTRY = "config/appifier.registry"
22
23
  end
23
24
 
24
- unless File::exist? File.expand_path(Appifier::DEFAULT_CONFIG_PATH)
25
+ Appifier::Helpers.constants.select { |c| Appifier::Helpers.const_get(c).is_a? Module }
26
+ .map { |item| item = "Appifier::Helpers::#{item}" }
27
+ .each { |mod| include Object.const_get(mod) }
28
+
29
+
30
+ require 'appifier/setup'
31
+ require 'appifier/actors/init'
32
+
33
+ unless File.exist? File.expand_path(Appifier::DEFAULT_CONFIG_PATH)
25
34
  puts "[W] Appifier not initialized for user #{current_user}, running setup"
26
- Appifier::Configuration.setup
27
- end
35
+ Appifier::Configuration.setup
36
+ end
28
37
 
29
38
  Carioca::Registry.configure do |spec|
30
- spec.init_from_file = false
39
+ spec.filename = "#{search_file_in_gem('appifier', Appifier::DEFAULT_REGISTRY )}"
40
+ spec.init_from_file = true
31
41
  spec.debug = true if ENV['DEBUG']
32
- spec.log_file = '/tmp/appifier.log'
33
- spec.config_file = './config/settings.yml'
42
+ spec.log_file = File.expand_path("#{Appifier::DEFAULT_LOGS_PATH}/#{Appifier::DEFAULT_LOG_FILENAME}")
43
+ spec.config_file = File.expand_path("#{Appifier::DEFAULT_CONFIG_PATH}/#{Appifier::DEFAULT_SETTINGS_FILENAME}")
34
44
  spec.config_root = :appifier
35
45
  spec.environment = :production
36
- spec.default_locale = :fr
37
- spec.locales_load_path << Dir[File.expand_path('./config/locales') + '/*.yml']
46
+ spec.output_mode = :dual
47
+ spec.output_emoji = true
48
+ spec.output_colors = true
38
49
  end
39
50
 
51
+ require_relative 'appifier/services/init'
40
52
 
41
53
  module Appifier
42
-
43
54
  class Application < Carioca::Container
44
55
  inject service: :configuration
45
56
  inject service: :i18n
46
- logger.info(to_s) { 'Running Appifier' }
47
-
57
+ inject service: :terminator
48
58
  end
59
+ end
49
60
 
50
- end
61
+ require_relative 'appifier/components/init'
@@ -0,0 +1,12 @@
1
+ ---
2
+ :template:
3
+ :dataset:
4
+ :appname:
5
+ :description: The application name
6
+ :default: test_application
7
+ :format: \w+
8
+ :actions:
9
+ :deploy: {}
10
+ :run: {}
11
+ :build: {}
12
+ :publish: {}
data/samples/dummy.tgz CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camille Paquet
@@ -9,8 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-10-19 00:00:00.000000000 Z
12
+ date: 2022-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: code_statistics
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 0.2.13
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 0.2.13
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: rake
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -26,61 +40,61 @@ dependencies:
26
40
  - !ruby/object:Gem::Version
27
41
  version: '12.0'
28
42
  - !ruby/object:Gem::Dependency
29
- name: rspec
43
+ name: roodi
30
44
  requirement: !ruby/object:Gem::Requirement
31
45
  requirements:
32
46
  - - "~>"
33
47
  - !ruby/object:Gem::Version
34
- version: '3.0'
48
+ version: '5.0'
35
49
  type: :development
36
50
  prerelease: false
37
51
  version_requirements: !ruby/object:Gem::Requirement
38
52
  requirements:
39
53
  - - "~>"
40
54
  - !ruby/object:Gem::Version
41
- version: '3.0'
55
+ version: '5.0'
42
56
  - !ruby/object:Gem::Dependency
43
- name: rubocop
57
+ name: rspec
44
58
  requirement: !ruby/object:Gem::Requirement
45
59
  requirements:
46
60
  - - "~>"
47
61
  - !ruby/object:Gem::Version
48
- version: '1.32'
62
+ version: '3.0'
49
63
  type: :development
50
64
  prerelease: false
51
65
  version_requirements: !ruby/object:Gem::Requirement
52
66
  requirements:
53
67
  - - "~>"
54
68
  - !ruby/object:Gem::Version
55
- version: '1.32'
69
+ version: '3.0'
56
70
  - !ruby/object:Gem::Dependency
57
- name: roodi
71
+ name: rubocop
58
72
  requirement: !ruby/object:Gem::Requirement
59
73
  requirements:
60
74
  - - "~>"
61
75
  - !ruby/object:Gem::Version
62
- version: '5.0'
76
+ version: '1.32'
63
77
  type: :development
64
78
  prerelease: false
65
79
  version_requirements: !ruby/object:Gem::Requirement
66
80
  requirements:
67
81
  - - "~>"
68
82
  - !ruby/object:Gem::Version
69
- version: '5.0'
83
+ version: '1.32'
70
84
  - !ruby/object:Gem::Dependency
71
- name: code_statistics
85
+ name: version
72
86
  requirement: !ruby/object:Gem::Requirement
73
87
  requirements:
74
88
  - - "~>"
75
89
  - !ruby/object:Gem::Version
76
- version: 0.2.13
90
+ version: '1.1'
77
91
  type: :development
78
92
  prerelease: false
79
93
  version_requirements: !ruby/object:Gem::Requirement
80
94
  requirements:
81
95
  - - "~>"
82
96
  - !ruby/object:Gem::Version
83
- version: 0.2.13
97
+ version: '1.1'
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: yard
86
100
  requirement: !ruby/object:Gem::Requirement
@@ -110,47 +124,47 @@ dependencies:
110
124
  - !ruby/object:Gem::Version
111
125
  version: '0.1'
112
126
  - !ruby/object:Gem::Dependency
113
- name: version
127
+ name: carioca
114
128
  requirement: !ruby/object:Gem::Requirement
115
129
  requirements:
116
130
  - - "~>"
117
131
  - !ruby/object:Gem::Version
118
- version: '1.1'
119
- type: :development
132
+ version: 2.0.9
133
+ type: :runtime
120
134
  prerelease: false
121
135
  version_requirements: !ruby/object:Gem::Requirement
122
136
  requirements:
123
137
  - - "~>"
124
138
  - !ruby/object:Gem::Version
125
- version: '1.1'
139
+ version: 2.0.9
126
140
  - !ruby/object:Gem::Dependency
127
- name: carioca
141
+ name: thor
128
142
  requirement: !ruby/object:Gem::Requirement
129
143
  requirements:
130
144
  - - "~>"
131
145
  - !ruby/object:Gem::Version
132
- version: '2.0'
146
+ version: '1.2'
133
147
  type: :runtime
134
148
  prerelease: false
135
149
  version_requirements: !ruby/object:Gem::Requirement
136
150
  requirements:
137
151
  - - "~>"
138
152
  - !ruby/object:Gem::Version
139
- version: '2.0'
153
+ version: '1.2'
140
154
  - !ruby/object:Gem::Dependency
141
- name: thor
155
+ name: tty-prompt
142
156
  requirement: !ruby/object:Gem::Requirement
143
157
  requirements:
144
158
  - - "~>"
145
159
  - !ruby/object:Gem::Version
146
- version: '1.2'
160
+ version: 0.23.1
147
161
  type: :runtime
148
162
  prerelease: false
149
163
  version_requirements: !ruby/object:Gem::Requirement
150
164
  requirements:
151
165
  - - "~>"
152
166
  - !ruby/object:Gem::Version
153
- version: '1.2'
167
+ version: 0.23.1
154
168
  description: 'Appifier : Applications templating and management tools '
155
169
  email:
156
170
  - gems@ultragreen.net
@@ -169,28 +183,37 @@ files:
169
183
  - appifier.gemspec
170
184
  - bin/console
171
185
  - bin/setup
186
+ - config/appifier.registry
172
187
  - config/settings.yml
173
188
  - exe/appifier
174
189
  - lib/appifier.rb
190
+ - lib/appifier/actors/collector.rb
175
191
  - lib/appifier/actors/generator.rb
176
192
  - lib/appifier/actors/init.rb
177
193
  - lib/appifier/actors/retriever.rb
178
194
  - lib/appifier/cli.rb
179
195
  - lib/appifier/cli/configuration.rb
180
196
  - lib/appifier/cli/templates.rb
197
+ - lib/appifier/components/Appifile.rb
198
+ - lib/appifier/components/init.rb
199
+ - lib/appifier/components/templates.rb
181
200
  - lib/appifier/helpers/archives.rb
201
+ - lib/appifier/helpers/datasets.rb
182
202
  - lib/appifier/helpers/gem.rb
183
203
  - lib/appifier/helpers/init.rb
184
204
  - lib/appifier/helpers/user.rb
205
+ - lib/appifier/services/finisher.rb
206
+ - lib/appifier/services/init.rb
185
207
  - lib/appifier/setup.rb
186
208
  - lib/appifier/version.rb
187
209
  - samples/dummy.tgz
188
- - samples/skeleton/%%APPNAME.downcase%%/.rspec
189
- - samples/skeleton/%%APPNAME.downcase%%/Rakefile
190
- - samples/skeleton/%%APPNAME.downcase%%/config.ru
191
- - samples/skeleton/%%APPNAME.downcase%%/exe/%%APPNAME.downcase%%
192
- - samples/skeleton/%%APPNAME.downcase%%/lib/%%APPNAME.downcase%%.rb
193
- - samples/skeleton/%%APPNAME.downcase%%/spec/%%APPNAME.downcase%%_spec.rb
210
+ - samples/dummy/Appifile
211
+ - samples/dummy/skeleton/%%APPNAME.downcase%%/.rspec
212
+ - samples/dummy/skeleton/%%APPNAME.downcase%%/Rakefile
213
+ - samples/dummy/skeleton/%%APPNAME.downcase%%/config.ru
214
+ - samples/dummy/skeleton/%%APPNAME.downcase%%/exe/%%APPNAME.downcase%%
215
+ - samples/dummy/skeleton/%%APPNAME.downcase%%/lib/%%APPNAME.downcase%%.rb
216
+ - samples/dummy/skeleton/%%APPNAME.downcase%%/spec/%%APPNAME.downcase%%_spec.rb
194
217
  homepage: https://github.com/Ultragreen/appifier
195
218
  licenses:
196
219
  - MIT