frap 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +4 -1
- data/Gemfile.lock +75 -3
- data/frap.gemspec +4 -1
- data/lib/frap/create_app.rb +6 -1
- data/lib/frap/generators/flutter_config.rb +16 -11
- data/lib/frap/generators/flutter_resource.rb +31 -26
- data/lib/frap/version.rb +1 -1
- metadata +47 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac19b3b7efe60fc1a00270be25530fbaf8d998653848578b34c70ed2cb5c8f9d
|
4
|
+
data.tar.gz: 53ca394edb94a37d41bea02382bd91b89a50b8ee9a858eb88b90962984354cdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b2951fb48b358db1cea3a4a70c415e2e5532d7543a980f4f11a18f8c114961f32a1118ae7dc9ab1df1e7f1f9d1347be9e7204fe3773bf447df9bf45adfe74d0
|
7
|
+
data.tar.gz: c7c3cc4b5eddc9c371c7cf2b8f0c141033be6c5ab347e678040b079cad70dd9ca05ecc780e92e54059758685593b4804cea9d92d30bfabbad58a497bcb7cc694
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
frap (0.2.
|
4
|
+
frap (0.2.2)
|
5
5
|
thor (~> 0.20.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
actioncable (5.2.3)
|
11
|
+
actionpack (= 5.2.3)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailer (5.2.3)
|
15
|
+
actionpack (= 5.2.3)
|
16
|
+
actionview (= 5.2.3)
|
17
|
+
activejob (= 5.2.3)
|
18
|
+
mail (~> 2.5, >= 2.5.4)
|
19
|
+
rails-dom-testing (~> 2.0)
|
10
20
|
actionpack (5.2.3)
|
11
21
|
actionview (= 5.2.3)
|
12
22
|
activesupport (= 5.2.3)
|
@@ -20,33 +30,77 @@ GEM
|
|
20
30
|
erubi (~> 1.4)
|
21
31
|
rails-dom-testing (~> 2.0)
|
22
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
+
activejob (5.2.3)
|
34
|
+
activesupport (= 5.2.3)
|
35
|
+
globalid (>= 0.3.6)
|
36
|
+
activemodel (5.2.3)
|
37
|
+
activesupport (= 5.2.3)
|
38
|
+
activerecord (5.2.3)
|
39
|
+
activemodel (= 5.2.3)
|
40
|
+
activesupport (= 5.2.3)
|
41
|
+
arel (>= 9.0)
|
42
|
+
activestorage (5.2.3)
|
43
|
+
actionpack (= 5.2.3)
|
44
|
+
activerecord (= 5.2.3)
|
45
|
+
marcel (~> 0.3.1)
|
23
46
|
activesupport (5.2.3)
|
24
47
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
48
|
i18n (>= 0.7, < 2)
|
26
49
|
minitest (~> 5.1)
|
27
50
|
tzinfo (~> 1.1)
|
51
|
+
arel (9.0.0)
|
52
|
+
bootsnap (1.1.0)
|
53
|
+
msgpack (~> 1.0)
|
28
54
|
builder (3.2.3)
|
29
55
|
concurrent-ruby (1.1.5)
|
30
56
|
crass (1.0.4)
|
31
57
|
diff-lcs (1.3)
|
32
58
|
erubi (1.8.0)
|
59
|
+
ffi (1.11.1)
|
60
|
+
globalid (0.4.2)
|
61
|
+
activesupport (>= 4.2.0)
|
33
62
|
i18n (1.6.0)
|
34
63
|
concurrent-ruby (~> 1.0)
|
64
|
+
listen (3.1.5)
|
65
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
66
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
67
|
+
ruby_dep (~> 1.2)
|
35
68
|
loofah (2.2.3)
|
36
69
|
crass (~> 1.0.2)
|
37
70
|
nokogiri (>= 1.5.9)
|
71
|
+
mail (2.7.1)
|
72
|
+
mini_mime (>= 0.1.1)
|
73
|
+
marcel (0.3.3)
|
74
|
+
mimemagic (~> 0.3.2)
|
38
75
|
method_source (0.9.2)
|
76
|
+
mimemagic (0.3.3)
|
77
|
+
mini_mime (1.0.2)
|
39
78
|
mini_portile2 (2.4.0)
|
40
79
|
minitest (5.11.3)
|
80
|
+
msgpack (1.3.1)
|
81
|
+
nio4r (2.4.0)
|
41
82
|
nokogiri (1.10.3)
|
42
83
|
mini_portile2 (~> 2.4.0)
|
43
84
|
rack (2.0.7)
|
44
85
|
rack-test (1.1.0)
|
45
86
|
rack (>= 1.0, < 3)
|
87
|
+
rails (5.2.3)
|
88
|
+
actioncable (= 5.2.3)
|
89
|
+
actionmailer (= 5.2.3)
|
90
|
+
actionpack (= 5.2.3)
|
91
|
+
actionview (= 5.2.3)
|
92
|
+
activejob (= 5.2.3)
|
93
|
+
activemodel (= 5.2.3)
|
94
|
+
activerecord (= 5.2.3)
|
95
|
+
activestorage (= 5.2.3)
|
96
|
+
activesupport (= 5.2.3)
|
97
|
+
bundler (>= 1.3.0)
|
98
|
+
railties (= 5.2.3)
|
99
|
+
sprockets-rails (>= 2.0.0)
|
46
100
|
rails-dom-testing (2.0.3)
|
47
101
|
activesupport (>= 4.2.0)
|
48
102
|
nokogiri (>= 1.6)
|
49
|
-
rails-html-sanitizer (1.0
|
103
|
+
rails-html-sanitizer (1.2.0)
|
50
104
|
loofah (~> 2.2, >= 2.2.2)
|
51
105
|
railties (5.2.3)
|
52
106
|
actionpack (= 5.2.3)
|
@@ -55,6 +109,9 @@ GEM
|
|
55
109
|
rake (>= 0.8.7)
|
56
110
|
thor (>= 0.19.0, < 2.0)
|
57
111
|
rake (10.5.0)
|
112
|
+
rb-fsevent (0.10.3)
|
113
|
+
rb-inotify (0.10.0)
|
114
|
+
ffi (~> 1.0)
|
58
115
|
rspec (3.7.0)
|
59
116
|
rspec-core (~> 3.7.0)
|
60
117
|
rspec-expectations (~> 3.7.0)
|
@@ -68,20 +125,35 @@ GEM
|
|
68
125
|
diff-lcs (>= 1.2.0, < 2.0)
|
69
126
|
rspec-support (~> 3.7.0)
|
70
127
|
rspec-support (3.7.1)
|
128
|
+
ruby_dep (1.5.0)
|
129
|
+
sprockets (3.7.2)
|
130
|
+
concurrent-ruby (~> 1.0)
|
131
|
+
rack (> 1, < 3)
|
132
|
+
sprockets-rails (3.2.1)
|
133
|
+
actionpack (>= 4.0)
|
134
|
+
activesupport (>= 4.0)
|
135
|
+
sprockets (>= 3.0.0)
|
136
|
+
sqlite3 (1.4.1)
|
71
137
|
thor (0.20.3)
|
72
138
|
thread_safe (0.3.6)
|
73
139
|
tzinfo (1.2.5)
|
74
140
|
thread_safe (~> 0.1)
|
141
|
+
websocket-driver (0.7.1)
|
142
|
+
websocket-extensions (>= 0.1.0)
|
143
|
+
websocket-extensions (0.1.4)
|
75
144
|
|
76
145
|
PLATFORMS
|
77
146
|
ruby
|
78
147
|
|
79
148
|
DEPENDENCIES
|
149
|
+
bootsnap (= 1.1.0)
|
80
150
|
bundler (~> 2.0.2)
|
81
151
|
frap!
|
82
|
-
|
152
|
+
listen (~> 3.1.5)
|
153
|
+
rails (= 5.2.3)
|
83
154
|
rake (~> 10.0)
|
84
155
|
rspec (~> 3.7.0)
|
156
|
+
sqlite3 (~> 1.3)
|
85
157
|
|
86
158
|
BUNDLED WITH
|
87
159
|
2.0.2
|
data/frap.gemspec
CHANGED
@@ -36,5 +36,8 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency "bundler", "~> 2.0.2"
|
37
37
|
spec.add_development_dependency "rake", "~> 10.0"
|
38
38
|
spec.add_development_dependency "rspec", "~> 3.7.0"
|
39
|
-
spec.add_development_dependency "
|
39
|
+
spec.add_development_dependency "bootsnap", "1.1.0"
|
40
|
+
spec.add_development_dependency "rails", "5.2.3"
|
41
|
+
spec.add_development_dependency "listen", "~> 3.1.5"
|
42
|
+
spec.add_development_dependency "sqlite3", "~> 1.3"
|
40
43
|
end
|
data/lib/frap/create_app.rb
CHANGED
@@ -17,7 +17,7 @@ module Frap
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def setup_parent_directory
|
20
|
-
shell.say(shell_text("Create Parent Directory #{name}"), :green)
|
20
|
+
shell.say(shell_text("Create Parent Directory #{name} in #{start_directory}"), :green)
|
21
21
|
|
22
22
|
Frap::Generators::Config.new(
|
23
23
|
[name],
|
@@ -74,6 +74,7 @@ module Frap
|
|
74
74
|
shell.say("flutter run", :green)
|
75
75
|
|
76
76
|
shell.say(shell_text('========================'), :green)
|
77
|
+
Dir.chdir(start_directory)
|
77
78
|
end
|
78
79
|
|
79
80
|
def server_name
|
@@ -88,6 +89,10 @@ module Frap
|
|
88
89
|
@working_dir ||= "#{Dir.pwd}/#{name}"
|
89
90
|
end
|
90
91
|
|
92
|
+
def start_directory
|
93
|
+
@start_directory ||= Dir.pwd
|
94
|
+
end
|
95
|
+
|
91
96
|
def shell
|
92
97
|
@shell ||= Thor::Shell::Color.new
|
93
98
|
end
|
@@ -19,6 +19,9 @@ module Frap
|
|
19
19
|
|
20
20
|
def create_directories
|
21
21
|
empty_directory("#{lib_directory}/src/animations")
|
22
|
+
empty_directory("#{lib_directory}/src/blocs")
|
23
|
+
empty_directory("#{lib_directory}/src/models")
|
24
|
+
empty_directory("#{lib_directory}/src/resources")
|
22
25
|
empty_directory("#{lib_directory}/src/config")
|
23
26
|
empty_directory("#{lib_directory}/src/constants")
|
24
27
|
empty_directory("#{lib_directory}/src/screens")
|
@@ -64,23 +67,25 @@ module Frap
|
|
64
67
|
end
|
65
68
|
|
66
69
|
def pub_files
|
67
|
-
|
68
|
-
dio: ^2.1.13
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
<<~EOF.chomp
|
71
|
+
\n dio: ^2.1.13
|
72
|
+
rxdart: ^0.22.0
|
73
|
+
bloc_pattern: ^2.2.3
|
74
|
+
http: ^0.12.0+2
|
75
|
+
EOF
|
72
76
|
end
|
73
77
|
|
74
78
|
def home_router
|
75
|
-
|
76
|
-
|
77
|
-
|
79
|
+
<<~EOF.chomp
|
80
|
+
\n case HomeScreenRoute:
|
81
|
+
return SlideRightRoute(widget:HomeScreen());
|
82
|
+
EOF
|
78
83
|
end
|
79
84
|
|
80
85
|
def home_route
|
81
|
-
|
82
|
-
|
83
|
-
|
86
|
+
<<~EOF.chomp
|
87
|
+
\n const Page(title: 'Home', icon: Icons.home, route: HomeScreenRoute),
|
88
|
+
EOF
|
84
89
|
end
|
85
90
|
end
|
86
91
|
end
|
@@ -9,6 +9,7 @@ module Frap
|
|
9
9
|
argument :name
|
10
10
|
argument :flutter_app_dir
|
11
11
|
argument :fields
|
12
|
+
|
12
13
|
def self.source_root
|
13
14
|
File.dirname(__FILE__) + '/templates/dart'
|
14
15
|
end
|
@@ -26,14 +27,14 @@ module Frap
|
|
26
27
|
def create_files
|
27
28
|
@name_capitalized_plural = name_capitalize_pluralize
|
28
29
|
@name_capitalized_single = name_capitalized_single
|
29
|
-
@name_downcased_plural =
|
30
|
+
@name_downcased_plural = name_downcased_pluralize
|
30
31
|
@lower_name = lower_name
|
31
32
|
@field_types = build_fields
|
32
33
|
@field_names = fields.keys
|
33
34
|
template('src/screens/base_index.dart.erb', "#{screen_path}/#{lower_name}_index_screen.dart")
|
34
35
|
template('src/screens/base_bottom_navigation.dart.erb', "#{screen_path}/#{lower_name}_show_screen.dart")
|
35
|
-
template('src/blocs/base_block.dart.erb', "#{src_directory}/blocs/#{
|
36
|
-
template('src/models/base_model.dart.erb', "#{src_directory}/models/#{
|
36
|
+
template('src/blocs/base_block.dart.erb', "#{src_directory}/blocs/#{name_downcased_pluralize}_bloc.dart")
|
37
|
+
template('src/models/base_model.dart.erb', "#{src_directory}/models/#{name_downcased_pluralize}.dart")
|
37
38
|
template('src/resources/base_api_provider.dart.erb', "#{src_directory}/resources/#{lower_name}_api_provider.dart")
|
38
39
|
invoke :connect_widgets
|
39
40
|
end
|
@@ -47,9 +48,6 @@ module Frap
|
|
47
48
|
inject_into_file("#{src_directory}/resources/repository.dart", repository_body, after: /^class Repository \{$/)
|
48
49
|
append_to_file("#{src_directory}/constants/routing.dart", "const String #{name}IndexScreenRoute = '/#{lower_name.pluralize }'; \n")
|
49
50
|
append_to_file("#{src_directory}/constants/routing.dart", "const String #{name}ShowScreenRoute = '/#{lower_name.singularize}';\n")
|
50
|
-
# Here we will make sure all imports are handled:
|
51
|
-
# Import new resource into routes route and constants
|
52
|
-
# Index page with bottom floating button for adding
|
53
51
|
# build detail screen with bottom navigations
|
54
52
|
# Link navigation buttons to Edit and back to list and delete
|
55
53
|
end
|
@@ -98,25 +96,29 @@ module Frap
|
|
98
96
|
end
|
99
97
|
|
100
98
|
def index_screen_router
|
101
|
-
|
102
|
-
|
103
|
-
|
99
|
+
<<~EOF.chomp
|
100
|
+
\n case #{name}IndexScreenRoute:
|
101
|
+
return SlideRightRoute(widget:#{name}IndexScreen());
|
102
|
+
EOF
|
104
103
|
end
|
105
104
|
|
106
105
|
def index_screen_route
|
107
|
-
|
108
|
-
const Page(title: '#{name.pluralize}', icon: Icons.home, route: #{name}IndexScreenRoute),
|
106
|
+
<<~EOF.chomp
|
107
|
+
\n const Page(title: '#{name.pluralize}', icon: Icons.home, route: #{name}IndexScreenRoute),
|
108
|
+
EOF
|
109
109
|
end
|
110
110
|
|
111
111
|
def show_screen_router
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
<<~EOF.chomp
|
113
|
+
\n case #{name}ShowScreenRoute:
|
114
|
+
return SlideRightRoute(widget:#{name}ShowScreen());
|
115
|
+
EOF
|
115
116
|
end
|
116
117
|
|
117
118
|
def show_screen_route
|
118
|
-
|
119
|
-
const Page(title: '#{name}', icon: Icons.home, route: #{name}ShowScreenRoute),
|
119
|
+
<<~EOF.chomp
|
120
|
+
\n const Page(title: '#{name}', icon: Icons.home, route: #{name}ShowScreenRoute),
|
121
|
+
EOF
|
120
122
|
end
|
121
123
|
|
122
124
|
def lower_name
|
@@ -131,26 +133,29 @@ module Frap
|
|
131
133
|
name.capitalize.pluralize
|
132
134
|
end
|
133
135
|
|
134
|
-
def
|
136
|
+
def name_downcased_pluralize
|
135
137
|
name.downcase.pluralize
|
136
138
|
end
|
137
139
|
|
138
140
|
def router_packages
|
139
|
-
|
140
|
-
|
141
|
-
import 'package:#{flutter_app_dir}/src/screens/#{lower_name}/#{lower_name}_show_screen.dart';
|
141
|
+
<<~EOF.chomp
|
142
|
+
\nimport 'package:#{flutter_app_dir}/src/screens/#{lower_name}/#{lower_name}_index_screen.dart';
|
143
|
+
import 'package:#{flutter_app_dir}/src/screens/#{lower_name}/#{lower_name}_show_screen.dart';
|
144
|
+
EOF
|
142
145
|
end
|
143
146
|
|
144
147
|
def repository_body
|
145
|
-
|
146
|
-
final #{lower_name}ApiProvider = #{name_capitalized_single}ApiProvider();
|
147
|
-
|
148
|
+
<<~EOF
|
149
|
+
\n final #{lower_name}ApiProvider = #{name_capitalized_single}ApiProvider();
|
150
|
+
Future<#{name_capitalize_pluralize}> fetchAll#{name_capitalize_pluralize}() => #{lower_name}ApiProvider.fetchAll#{name_capitalize_pluralize}();
|
151
|
+
EOF
|
148
152
|
end
|
149
153
|
|
150
154
|
def repository_packages
|
151
|
-
|
152
|
-
|
153
|
-
import 'package:#{flutter_app_dir}/src/models/#{
|
155
|
+
<<~EOF.chomp
|
156
|
+
\nimport 'package:#{flutter_app_dir}/src/resources/#{lower_name}_api_provider.dart';
|
157
|
+
import 'package:#{flutter_app_dir}/src/models/#{name_downcased_pluralize}.dart';
|
158
|
+
EOF
|
154
159
|
end
|
155
160
|
end
|
156
161
|
end
|
data/lib/frap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Gascoigne - Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -67,19 +67,61 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 3.7.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: bootsnap
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.1.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.1.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: 5.2.3
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - '='
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: 5.2.3
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: listen
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 3.1.5
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 3.1.5
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: sqlite3
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.3'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.3'
|
83
125
|
description: CLI to create a Flutter App backed with a Rails server for quick app
|
84
126
|
protoyping
|
85
127
|
email:
|