frap 0.0.3 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/Gemfile.lock +53 -1
- data/README.md +5 -4
- data/bin/frap +1 -40
- data/frap.gemspec +3 -1
- data/lib/frap.rb +30 -0
- data/lib/frap/create_app.rb +59 -18
- data/lib/frap/generators/config.rb +30 -0
- data/lib/frap/generators/flutter_config.rb +61 -0
- data/lib/frap/generators/generate.rb +17 -0
- data/lib/frap/generators/resource.rb +42 -0
- data/lib/frap/generators/templates/config.erb +3 -0
- data/lib/frap/generators/templates/dart/main.dart.erb +4 -0
- data/lib/frap/generators/templates/dart/src/app_bloc.dart.erb +9 -0
- data/lib/frap/generators/templates/dart/src/app_module.dart.erb +19 -0
- data/lib/frap/generators/templates/dart/src/app_widget.dart.erb +15 -0
- data/lib/frap/generators/templates/dart/src/home/home_bloc.dart.erb +9 -0
- data/lib/frap/generators/templates/dart/src/home/home_module.dart.erb +19 -0
- data/lib/frap/generators/templates/dart/src/home/home_page.dart.erb +20 -0
- data/lib/frap/version.rb +1 -1
- metadata +42 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c9b0b37bc3db97c0fa4da096081a9172a2a4579eb185ea1b3a3613e2eec9e53
|
4
|
+
data.tar.gz: 5c701bc7b28b449fa300f4c3449d07bda9b530983ae2d67637cb3b1891feb8d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99fcc47f280d953775d23f796ebc76c19196b2c21bdf183860854310f5ff188056e53599bdd4f6c4c239592ebcb5db9a24227c3d7c5500f79adc7b19205beb02
|
7
|
+
data.tar.gz: 1407e786731d16af8f5b8d9b2ebb3f9dfcbd182e1b29cfacc4e0d856b2189f766c9433e51b52dac2786dfd9ab067f7aaa02225ad3636f9c5dfdc34023e86321e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,59 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
frap (0.
|
4
|
+
frap (0.1.1)
|
5
|
+
thor (~> 0.20.3)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
10
|
+
actionpack (5.2.3)
|
11
|
+
actionview (= 5.2.3)
|
12
|
+
activesupport (= 5.2.3)
|
13
|
+
rack (~> 2.0)
|
14
|
+
rack-test (>= 0.6.3)
|
15
|
+
rails-dom-testing (~> 2.0)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
+
actionview (5.2.3)
|
18
|
+
activesupport (= 5.2.3)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubi (~> 1.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
23
|
+
activesupport (5.2.3)
|
24
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
|
+
i18n (>= 0.7, < 2)
|
26
|
+
minitest (~> 5.1)
|
27
|
+
tzinfo (~> 1.1)
|
28
|
+
builder (3.2.3)
|
29
|
+
concurrent-ruby (1.1.5)
|
30
|
+
crass (1.0.4)
|
9
31
|
diff-lcs (1.3)
|
32
|
+
erubi (1.8.0)
|
33
|
+
i18n (1.6.0)
|
34
|
+
concurrent-ruby (~> 1.0)
|
35
|
+
loofah (2.2.3)
|
36
|
+
crass (~> 1.0.2)
|
37
|
+
nokogiri (>= 1.5.9)
|
38
|
+
method_source (0.9.2)
|
39
|
+
mini_portile2 (2.4.0)
|
40
|
+
minitest (5.11.3)
|
41
|
+
nokogiri (1.10.3)
|
42
|
+
mini_portile2 (~> 2.4.0)
|
43
|
+
rack (2.0.7)
|
44
|
+
rack-test (1.1.0)
|
45
|
+
rack (>= 1.0, < 3)
|
46
|
+
rails-dom-testing (2.0.3)
|
47
|
+
activesupport (>= 4.2.0)
|
48
|
+
nokogiri (>= 1.6)
|
49
|
+
rails-html-sanitizer (1.0.4)
|
50
|
+
loofah (~> 2.2, >= 2.2.2)
|
51
|
+
railties (5.2.3)
|
52
|
+
actionpack (= 5.2.3)
|
53
|
+
activesupport (= 5.2.3)
|
54
|
+
method_source
|
55
|
+
rake (>= 0.8.7)
|
56
|
+
thor (>= 0.19.0, < 2.0)
|
10
57
|
rake (10.5.0)
|
11
58
|
rspec (3.7.0)
|
12
59
|
rspec-core (~> 3.7.0)
|
@@ -21,6 +68,10 @@ GEM
|
|
21
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
69
|
rspec-support (~> 3.7.0)
|
23
70
|
rspec-support (3.7.1)
|
71
|
+
thor (0.20.3)
|
72
|
+
thread_safe (0.3.6)
|
73
|
+
tzinfo (1.2.5)
|
74
|
+
thread_safe (~> 0.1)
|
24
75
|
|
25
76
|
PLATFORMS
|
26
77
|
ruby
|
@@ -28,6 +79,7 @@ PLATFORMS
|
|
28
79
|
DEPENDENCIES
|
29
80
|
bundler (~> 2.0.2)
|
30
81
|
frap!
|
82
|
+
railties (~> 5.2.3)
|
31
83
|
rake (~> 10.0)
|
32
84
|
rspec (~> 3.7.0)
|
33
85
|
|
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
[![Build Status](https://travis-ci.com/flippakitten/frap.svg?branch=master)](https://travis-ci.com/flippakitten/frap)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/frap.svg)](https://badge.fury.io/rb/frap) [![Join the chat at https://gitter.im/frap-flutter-rails-cli/community](https://badges.gitter.im/frap-flutter-rails-cli/community.svg)](https://gitter.im/frap-flutter-rails-cli/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
2
3
|
# Frap
|
3
|
-
CLI interface to quickly prototype Flutter App's using the BLoC pattern with a Rails API server.
|
4
|
-
|
4
|
+
CLI interface to quickly prototype Flutter App's using the BLoC pattern with a Rails API server.
|
5
|
+
|
6
|
+
[changelog](https://github.com/flippakitten/frap/wiki/Change-Log-Published)
|
7
|
+
[roadmap](https://github.com/flippakitten/frap/projects/1)
|
5
8
|
|
6
9
|
## Prerequisites
|
7
|
-
While building the CLI, we will be using [slidy](https://pub.dev/packages/slidy) CLI. This will mean initially there will be some limitations, there is a plan to remove the dependancy in later versions.
|
8
10
|
|
9
11
|
Ensure the following are installed:
|
10
12
|
* [Flutter](https://flutter.dev/docs/get-started/install)
|
11
|
-
* [Slidy](https://pub.dev/packages/slidy#instalation)
|
12
13
|
* [Ruby 2.6.1](https://rvm.io/rvm/install) (I've used RVM but you can install it anyway)
|
13
14
|
* Rails
|
14
15
|
|
data/bin/frap
CHANGED
@@ -2,43 +2,4 @@
|
|
2
2
|
require 'frap'
|
3
3
|
require 'optparse'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
opt_parser = OptionParser.new do |opt|
|
8
|
-
opt.banner = "Usage: frap COMMAND [OPTIONS]"
|
9
|
-
opt.separator ""
|
10
|
-
opt.separator "Commands"
|
11
|
-
opt.separator " new: create a new Flutter and Rails app (requires app name as second argument"
|
12
|
-
opt.separator " generate: generates a template"
|
13
|
-
opt.separator ""
|
14
|
-
opt.separator "Options"
|
15
|
-
|
16
|
-
opt.on("-f","--fields FIELDS","comman separated list of fields with types") do |fields|
|
17
|
-
options[:fields] = fields
|
18
|
-
end
|
19
|
-
|
20
|
-
opt.on("-h","--help","help") do
|
21
|
-
puts opt_parser
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
opt_parser.parse!
|
26
|
-
|
27
|
-
case ARGV[0]
|
28
|
-
when "new"
|
29
|
-
unless ARGV[1]
|
30
|
-
puts "ERROR: Please specify an app path `frap new APP_PATH`"
|
31
|
-
return
|
32
|
-
end
|
33
|
-
|
34
|
-
Frap::CreateApp.new(ARGV[1]).build
|
35
|
-
when 'g'
|
36
|
-
when "generate"
|
37
|
-
unless ARGV[1]
|
38
|
-
puts "ERROR: Please specify a generator function `frap g resource MyResource -f name:string`"
|
39
|
-
return
|
40
|
-
end
|
41
|
-
puts "generate #{ARGV[1]} #{options[:fields]}"
|
42
|
-
else
|
43
|
-
puts opt_parser
|
44
|
-
end
|
5
|
+
Frap::CLI.start(ARGV)
|
data/frap.gemspec
CHANGED
@@ -25,14 +25,16 @@ Gem::Specification.new do |spec|
|
|
25
25
|
# Specify which files should be added to the gem when it is released.
|
26
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
27
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
28
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|docs)/}) }
|
29
29
|
end
|
30
30
|
spec.bindir = "bin"
|
31
31
|
spec.executables = ['frap']
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
spec.required_ruby_version = '>= 2.6.1'
|
34
|
+
spec.add_dependency 'thor', '~> 0.20.3'
|
34
35
|
|
35
36
|
spec.add_development_dependency "bundler", "~> 2.0.2"
|
36
37
|
spec.add_development_dependency "rake", "~> 10.0"
|
37
38
|
spec.add_development_dependency "rspec", "~> 3.7.0"
|
39
|
+
spec.add_development_dependency "railties", "~> 5.2.3"
|
38
40
|
end
|
data/lib/frap.rb
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
require 'frap/version'
|
2
2
|
require 'frap/create_app'
|
3
|
+
require 'frap/generators/generate'
|
4
|
+
require 'frap/generators/config'
|
5
|
+
require 'frap/generators/flutter_config'
|
6
|
+
require 'thor'
|
7
|
+
require 'yaml'
|
3
8
|
|
4
9
|
module Frap
|
10
|
+
class CLI < Thor
|
11
|
+
desc 'version', 'Display MyGem version'
|
12
|
+
map %w[-v --version] => :version
|
13
|
+
class_option 'verbose', type: :boolean, default: false
|
14
|
+
|
15
|
+
def version
|
16
|
+
say "Frap #{Frap::VERSION}"
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'new APP_NAME', 'Lower cased underscored app name'
|
20
|
+
long_desc <<-LONGDESC
|
21
|
+
Using the "app_name", it will create the parent directory and the Rails and Flutter sub directories,
|
22
|
+
"app_name_server" and "app_name_ui"
|
23
|
+
LONGDESC
|
24
|
+
def new(app_name)
|
25
|
+
CreateApp.new(app_name).build
|
26
|
+
end
|
27
|
+
|
28
|
+
desc 'generate GENERATOR RESOURCE_NAME', 'Specify the generator and a name'
|
29
|
+
long_desc <<-LONGDESC
|
30
|
+
Generate all the boiler plate code such as controllers, pages and blocks for Rails and Flutter.
|
31
|
+
run `frap g help` to see a list of existing generators
|
32
|
+
LONGDESC
|
33
|
+
subcommand 'generate', Frap::Generators::Generate
|
34
|
+
end
|
5
35
|
end
|
data/lib/frap/create_app.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'frap/generators/config'
|
3
|
+
|
1
4
|
module Frap
|
2
5
|
class CreateApp
|
3
6
|
attr_accessor :name
|
@@ -7,44 +10,82 @@ module Frap
|
|
7
10
|
end
|
8
11
|
|
9
12
|
def build
|
10
|
-
|
13
|
+
setup_parent_directory
|
11
14
|
create_rails_api_server
|
12
15
|
create_flutter_app
|
13
|
-
|
16
|
+
setup_bloc_pattern
|
14
17
|
show_completed_notes
|
15
18
|
end
|
16
19
|
|
17
20
|
private
|
18
21
|
|
19
|
-
def
|
20
|
-
|
22
|
+
def setup_parent_directory
|
23
|
+
shell.say(shell_text("Create Parent Directory #{name}"), :green)
|
24
|
+
|
25
|
+
Frap::Generators::Config.new(
|
26
|
+
[name],
|
27
|
+
options: {
|
28
|
+
destination_root: Dir.pwd
|
29
|
+
}
|
30
|
+
).invoke(:configure_directories)
|
21
31
|
|
22
|
-
|
23
|
-
Dir.chdir(name)
|
32
|
+
Dir.chdir(working_dir)
|
24
33
|
end
|
25
34
|
|
26
35
|
def create_rails_api_server
|
27
|
-
|
36
|
+
shell.say(shell_text("Rails new #{server_name} --api -T"), :green)
|
28
37
|
|
29
|
-
system("rails new #{
|
38
|
+
Kernel.system("rails new #{server_name} --api -T")
|
30
39
|
end
|
31
40
|
|
32
41
|
def create_flutter_app
|
33
|
-
|
34
|
-
|
42
|
+
shell.say(shell_text("Flutter create app #{ui_name}"), :green)
|
43
|
+
|
44
|
+
Kernel.system("flutter create #{ui_name}")
|
35
45
|
end
|
36
46
|
|
37
|
-
def
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
47
|
+
def setup_bloc_pattern
|
48
|
+
shell.say(shell_text('Setup BLoC pattern'), :green)
|
49
|
+
|
50
|
+
Frap::Generators::FlutterConfig.new(
|
51
|
+
[name, ui_name],
|
52
|
+
options: {
|
53
|
+
destination_root: Dir.pwd
|
54
|
+
}
|
55
|
+
).invoke(:configure_directories)
|
56
|
+
|
57
|
+
Dir.chdir("#{working_dir}/#{ui_name}")
|
58
|
+
Kernel.system('git init && flutter pub get')
|
59
|
+
Dir.chdir(working_dir)
|
43
60
|
end
|
44
61
|
|
45
62
|
def show_completed_notes
|
46
|
-
|
47
|
-
|
63
|
+
shell.say(shell_text('DONE'), :green)
|
64
|
+
shell.say('TODO: Install your favourite Rails Testing library', :yellow)
|
65
|
+
end
|
66
|
+
|
67
|
+
def server_name
|
68
|
+
"#{name}_server"
|
69
|
+
end
|
70
|
+
|
71
|
+
def ui_name
|
72
|
+
"#{name}_ui"
|
73
|
+
end
|
74
|
+
|
75
|
+
def working_dir
|
76
|
+
@working_dir ||= "#{Dir.pwd}/#{name}"
|
77
|
+
end
|
78
|
+
|
79
|
+
def shell
|
80
|
+
@shell ||= Thor::Shell::Color.new
|
81
|
+
end
|
82
|
+
|
83
|
+
def shell_text(text)
|
84
|
+
"#{spacer} #{text} #{spacer}"
|
85
|
+
end
|
86
|
+
|
87
|
+
def spacer
|
88
|
+
'================'
|
48
89
|
end
|
49
90
|
end
|
50
91
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'thor/group'
|
3
|
+
|
4
|
+
module Frap
|
5
|
+
module Generators
|
6
|
+
class Config < Thor::Group
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
desc 'Generate a config file'
|
10
|
+
argument :name
|
11
|
+
|
12
|
+
def self.source_root
|
13
|
+
File.dirname(__FILE__) + '/templates'
|
14
|
+
end
|
15
|
+
|
16
|
+
def configure_directories
|
17
|
+
invoke :create_app_dir
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_app_dir
|
21
|
+
empty_directory(name)
|
22
|
+
invoke :create_config_file
|
23
|
+
end
|
24
|
+
|
25
|
+
def create_config_file
|
26
|
+
template('config.erb', "#{name}/config.yml")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
|
2
|
+
require 'thor'
|
3
|
+
require 'thor/group'
|
4
|
+
|
5
|
+
module Frap
|
6
|
+
module Generators
|
7
|
+
class FlutterConfig < Thor::Group
|
8
|
+
include Thor::Actions
|
9
|
+
|
10
|
+
desc 'Generate Flutter Config files'
|
11
|
+
argument :name
|
12
|
+
argument :folder_name
|
13
|
+
|
14
|
+
def self.source_root
|
15
|
+
File.dirname(__FILE__) + '/templates/dart'
|
16
|
+
end
|
17
|
+
|
18
|
+
def configure_directories
|
19
|
+
inject_into_file("#{working_directory}/pubspec.yaml", pub_files, after: /^dependencies:.*$/)
|
20
|
+
remove_file("#{lib_directory}/main.dart")
|
21
|
+
invoke :create_directories
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_directories
|
25
|
+
empty_directory("#{lib_directory}/src/home")
|
26
|
+
invoke :create_files
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_files
|
30
|
+
template('main.dart.erb', "#{lib_directory}/main.dart")
|
31
|
+
template('src/app_bloc.dart.erb', "#{src_directory}/app_bloc.dart")
|
32
|
+
template('src/app_module.dart.erb', "#{src_directory}/app_module.dart")
|
33
|
+
template('src/app_widget.dart.erb', "#{src_directory}/app_widget.dart")
|
34
|
+
template('src/home/home_bloc.dart.erb', "#{src_directory}/home/home_bloc.dart")
|
35
|
+
template('src/home/home_module.dart.erb', "#{src_directory}/home/home_module.dart")
|
36
|
+
template('src/home/home_page.dart.erb', "#{src_directory}/home/home_page.dart")
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def working_directory
|
42
|
+
"#{destination_root}/#{folder_name}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def lib_directory
|
46
|
+
"#{working_directory}/lib"
|
47
|
+
end
|
48
|
+
|
49
|
+
def src_directory
|
50
|
+
"#{lib_directory}/src"
|
51
|
+
end
|
52
|
+
|
53
|
+
def pub_files
|
54
|
+
%Q(
|
55
|
+
dio: ^2.1.13
|
56
|
+
rxdart: ^0.22.0
|
57
|
+
bloc_pattern: ^2.2.3)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'frap/generators/resource'
|
3
|
+
|
4
|
+
module Frap
|
5
|
+
module Generators
|
6
|
+
class Generate < Thor
|
7
|
+
desc 'resource NAME', 'generate a resource'
|
8
|
+
method_option :rails, type: :boolean, aliases: :r, default: true
|
9
|
+
method_option :flutter, type: :boolean, aliases: :f, default: true
|
10
|
+
method_option :attributes, type: :hash, aliases: :a
|
11
|
+
|
12
|
+
def resource(name)
|
13
|
+
Frap::Generators::Resource.new(name, options).create_resource
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module Frap
|
4
|
+
module Generators
|
5
|
+
class Resource
|
6
|
+
attr_accessor :name, :attributes, :options
|
7
|
+
|
8
|
+
def initialize(name, options)
|
9
|
+
@name = name
|
10
|
+
@options = options
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_resource
|
14
|
+
generate_rails_resource if options['rails']
|
15
|
+
generate_flutter_resource if options['flutter']
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def generate_rails_resource
|
21
|
+
|
22
|
+
|
23
|
+
puts "TODO: rails g resource #{fields}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def generate_flutter_resource
|
27
|
+
puts "TODO: frap g flutter resource #{fields}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def fields
|
31
|
+
@fields ||= build_fields
|
32
|
+
end
|
33
|
+
|
34
|
+
def build_fields
|
35
|
+
fields_string = ''
|
36
|
+
options[:attributes].each { |k, v| fields_string << "#{k}:#{v} " }
|
37
|
+
|
38
|
+
return fields_string
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import 'package:bloc_pattern/bloc_pattern.dart';
|
2
|
+
import 'package:flutter/material.dart';
|
3
|
+
import 'package:<%= folder_name %>/src/app_widget.dart';
|
4
|
+
import 'package:<%= folder_name %>/src/app_bloc.dart';
|
5
|
+
|
6
|
+
class AppModule extends ModuleWidget {
|
7
|
+
@override
|
8
|
+
List<Bloc> get blocs => [
|
9
|
+
Bloc((i) => AppBloc()),
|
10
|
+
];
|
11
|
+
|
12
|
+
@override
|
13
|
+
List<Dependency> get dependencies => [];
|
14
|
+
|
15
|
+
@override
|
16
|
+
Widget get view => AppWidget();
|
17
|
+
|
18
|
+
static Inject get to => Inject<AppModule>.of();
|
19
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import 'package:flutter/material.dart';
|
2
|
+
import 'package:<%= folder_name %>/src/home/home_module.dart';
|
3
|
+
|
4
|
+
class AppWidget extends StatelessWidget {
|
5
|
+
@override
|
6
|
+
Widget build(BuildContext context) {
|
7
|
+
return MaterialApp(
|
8
|
+
title: '<%= name.split(/ |\_|\-/).map(&:capitalize).join(' ') %> App',
|
9
|
+
theme: ThemeData(
|
10
|
+
primarySwatch: Colors.blue,
|
11
|
+
),
|
12
|
+
home: HomeModule(),
|
13
|
+
);
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import 'package:<%= folder_name %>/src/home/home_bloc.dart';
|
2
|
+
import 'package:bloc_pattern/bloc_pattern.dart';
|
3
|
+
import 'package:flutter/material.dart';
|
4
|
+
import 'package:<%= folder_name %>/src/home/home_page.dart';
|
5
|
+
|
6
|
+
class HomeModule extends ModuleWidget {
|
7
|
+
@override
|
8
|
+
List<Bloc> get blocs => [
|
9
|
+
Bloc((i) => HomeBloc()),
|
10
|
+
];
|
11
|
+
|
12
|
+
@override
|
13
|
+
List<Dependency> get dependencies => [];
|
14
|
+
|
15
|
+
@override
|
16
|
+
Widget get view => HomePage();
|
17
|
+
|
18
|
+
static Inject get to => Inject<HomeModule>.of();
|
19
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import 'package:flutter/material.dart';
|
2
|
+
|
3
|
+
class HomePage extends StatefulWidget {
|
4
|
+
@override
|
5
|
+
_HomePageState createState() => _HomePageState();
|
6
|
+
}
|
7
|
+
|
8
|
+
class _HomePageState extends State<HomePage> {
|
9
|
+
@override
|
10
|
+
Widget build(BuildContext context) {
|
11
|
+
return Scaffold(
|
12
|
+
appBar: AppBar(
|
13
|
+
title: Text("Home"),
|
14
|
+
),
|
15
|
+
body: Center(
|
16
|
+
child: Text('<%= folder_name %> Home'),
|
17
|
+
),
|
18
|
+
);
|
19
|
+
}
|
20
|
+
}
|
data/lib/frap/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
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-07-
|
11
|
+
date: 2019-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.20.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.20.3
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +66,20 @@ dependencies:
|
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: 3.7.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: railties
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 5.2.3
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 5.2.3
|
55
83
|
description: CLI to create a Flutter App backed with a Rails server for quick app
|
56
84
|
protoyping
|
57
85
|
email:
|
@@ -77,6 +105,18 @@ files:
|
|
77
105
|
- frap.gemspec
|
78
106
|
- lib/frap.rb
|
79
107
|
- lib/frap/create_app.rb
|
108
|
+
- lib/frap/generators/config.rb
|
109
|
+
- lib/frap/generators/flutter_config.rb
|
110
|
+
- lib/frap/generators/generate.rb
|
111
|
+
- lib/frap/generators/resource.rb
|
112
|
+
- lib/frap/generators/templates/config.erb
|
113
|
+
- lib/frap/generators/templates/dart/main.dart.erb
|
114
|
+
- lib/frap/generators/templates/dart/src/app_bloc.dart.erb
|
115
|
+
- lib/frap/generators/templates/dart/src/app_module.dart.erb
|
116
|
+
- lib/frap/generators/templates/dart/src/app_widget.dart.erb
|
117
|
+
- lib/frap/generators/templates/dart/src/home/home_bloc.dart.erb
|
118
|
+
- lib/frap/generators/templates/dart/src/home/home_module.dart.erb
|
119
|
+
- lib/frap/generators/templates/dart/src/home/home_page.dart.erb
|
80
120
|
- lib/frap/version.rb
|
81
121
|
homepage: https://github.com/flippakitten/frap
|
82
122
|
licenses:
|