dfb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b9e0fc11f3033dfdc2c9aebadf9c6a7f5bf1c98b5384e522034f7744bc4f87b2
4
+ data.tar.gz: 4ff783c7af5d9b93346fc0464c272938c0f1703e598c8f95284d88f433651fb4
5
+ SHA512:
6
+ metadata.gz: 94375d2febe96df071d0b472db37e702680326efe13896e977f1653115b51d325c2932f4d0204b8864172533afbfb69df6ff8404ea1efcb8386ba8b451c7c933
7
+ data.tar.gz: 3886685a97ab9c512faa667d731a177f53b74b32c6ae545b3aae6fe142c0bb4c0b40a3b4dd980d344a1cb4c85ed0735d0b1b48e8034b97bd99429628f406dd04
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,6 @@
1
+ = dfb
2
+
3
+ Describe your project here
4
+
5
+ :include:dfb.rdoc
6
+
@@ -0,0 +1,44 @@
1
+ require 'rake/clean'
2
+ require 'rubygems'
3
+ require 'rubygems/package_task'
4
+ require 'rdoc/task'
5
+ require 'cucumber'
6
+ require 'cucumber/rake/task'
7
+ Rake::RDocTask.new do |rd|
8
+ rd.main = "README.rdoc"
9
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
10
+ rd.title = 'Your application title'
11
+ end
12
+
13
+ spec = eval(File.read('dfb.gemspec'))
14
+
15
+ Gem::PackageTask.new(spec) do |pkg|
16
+ end
17
+ CUKE_RESULTS = 'results.html'
18
+ CLEAN << CUKE_RESULTS
19
+ desc 'Run features'
20
+ Cucumber::Rake::Task.new(:features) do |t|
21
+ opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
22
+ opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
23
+ t.cucumber_opts = opts
24
+ t.fork = false
25
+ end
26
+
27
+ desc 'Run features tagged as work-in-progress (@wip)'
28
+ Cucumber::Rake::Task.new('features:wip') do |t|
29
+ tag_opts = ' --tags ~@pending'
30
+ tag_opts = ' --tags @wip'
31
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
32
+ t.fork = false
33
+ end
34
+
35
+ task :cucumber => :features
36
+ task 'cucumber:wip' => 'features:wip'
37
+ task :wip => 'features:wip'
38
+ require 'rake/testtask'
39
+ Rake::TestTask.new do |t|
40
+ t.libs << "test"
41
+ t.test_files = FileList['test/*_test.rb']
42
+ end
43
+
44
+ task :default => [:test,:features]
data/bin/dfb ADDED
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ # begin # XXX: Remove this begin/rescue before distributing your app
4
+ require 'DictFlutterCommand'
5
+ # rescue LoadError
6
+ # STDERR.puts "In development, you need to use `bundle exec bin/DictFlutterCommand` to run your app"
7
+ # STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
8
+ # STDERR.puts "Feel free to remove this message from bin/DictFlutterCommand now"
9
+ # exit 64
10
+ # end
11
+
12
+ class App
13
+ extend GLI::App
14
+
15
+ program_desc '词典flutter工程管理命令'
16
+
17
+ version DictFlutterCommand::VERSION
18
+
19
+ subcommand_option_handling :normal
20
+ arguments :strict
21
+
22
+ desc 'Describe some switch here'
23
+ switch [:s,:switch]
24
+
25
+ desc 'Describe some flag here'
26
+ default_value 'the default'
27
+ arg_name 'The name of the argument'
28
+ flag [:f,:flagname]
29
+
30
+ desc 'Describe list here'
31
+ arg_name 'Describe arguments to list here'
32
+ command :list do |c|
33
+ c.desc 'Describe a switch to list'
34
+ c.switch :s
35
+
36
+ c.desc 'Describe a flag to list'
37
+ c.default_value 'default'
38
+ c.flag :f
39
+ c.action do |global_options,options,args|
40
+
41
+ # Your command logic here
42
+
43
+ # If you have any errors, just raise them
44
+ # raise "that command made no sense"
45
+
46
+ puts "list command ran"
47
+ end
48
+ end
49
+
50
+ desc '下载词典flutter工程'
51
+ arg_name 'Describe arguments to complete here'
52
+ command :clone do |c|
53
+ c.action do |global_options,options,args|
54
+ DictFlutterCommand.clone
55
+ end
56
+ end
57
+
58
+ desc '配置flutter环境'
59
+ arg_name 'Describe arguments to add here'
60
+ command :init_flutter do |c|
61
+ c.action do |global_options,options,args|
62
+ DictFlutterCommand.init_flutter
63
+ end
64
+ end
65
+
66
+ desc '运行ios demo工程'
67
+ arg_name 'Describe arguments to add here'
68
+ command :run_ios do |c|
69
+ c.action do |global_options,options,args|
70
+ DictFlutterCommand.run_ios
71
+ end
72
+ end
73
+
74
+ desc '运行android demo工程'
75
+ arg_name 'Describe arguments to add here'
76
+ command :run_android do |c|
77
+ c.action do |global_options,options,args|
78
+ DictFlutterCommand.run_android
79
+ end
80
+ end
81
+
82
+ desc '链接到手机'
83
+ arg_name 'Describe arguments to add here'
84
+ command :attach do |c|
85
+ c.action do |global_options,options,args|
86
+ DictFlutterCommand.attach
87
+ end
88
+ end
89
+
90
+ desc '创建一个flutter package'
91
+ arg_name 'Describe arguments to add here'
92
+ command :create_package do |c|
93
+ c.action do |global_options,options,args|
94
+ DictFlutterCommand.create_package(args[0])
95
+ end
96
+ end
97
+
98
+ desc 'flutter pub get'
99
+ arg_name 'Describe arguments to add here'
100
+ command :pub_get do |c|
101
+ c.action do |global_options,options,args|
102
+ DictFlutterCommand.pub_get
103
+ end
104
+ end
105
+
106
+ desc 'flutter clean'
107
+ arg_name 'Describe arguments to add here'
108
+ command :flutter_clean do |c|
109
+ c.action do |global_options,options,args|
110
+ DictFlutterCommand.flutter_clean
111
+ end
112
+ end
113
+
114
+ pre do |global,command,options,args|
115
+ # Pre logic here
116
+ # Return true to proceed; false to abort and not call the
117
+ # chosen command
118
+ # Use skips_pre before a command to skip this block
119
+ # on that command only
120
+ true
121
+ end
122
+
123
+ post do |global,command,options,args|
124
+ # Post logic here
125
+ # Use skips_post before a command to skip this
126
+ # block on that command only
127
+ end
128
+
129
+ on_error do |exception|
130
+ # Error logic here
131
+ # return false to skip default error handling
132
+ true
133
+ end
134
+ end
135
+
136
+ exit App.run(ARGV)
@@ -0,0 +1,22 @@
1
+ # Ensure we require the local version and not one we might have installed already
2
+ require File.join([File.dirname(__FILE__),'lib','dfb','version.rb'])
3
+ spec = Gem::Specification.new do |s|
4
+ s.name = 'dfb'
5
+ s.version = Dfb::VERSION
6
+ s.author = 'Your Name Here'
7
+ s.email = 'your@email.address.com'
8
+ s.homepage = 'http://your.website.com'
9
+ s.platform = Gem::Platform::RUBY
10
+ s.summary = 'A description of your project'
11
+ s.files = `git ls-files`.split("
12
+ ")
13
+ s.require_paths << 'lib'
14
+ s.extra_rdoc_files = ['README.rdoc','dfb.rdoc']
15
+ s.rdoc_options << '--title' << 'dfb' << '--main' << 'README.rdoc' << '-ri'
16
+ s.bindir = 'bin'
17
+ s.executables << 'dfb'
18
+ s.add_development_dependency('rake')
19
+ s.add_development_dependency('rdoc')
20
+ s.add_development_dependency('aruba')
21
+ s.add_runtime_dependency('gli','2.19.0')
22
+ end
@@ -0,0 +1,5 @@
1
+ = dfb
2
+
3
+ Generate this with
4
+ dfb _doc
5
+ After you have described your command line interface
@@ -0,0 +1,8 @@
1
+ Feature: My bootstrapped app kinda works
2
+ In order to get going on coding my awesome app
3
+ I want to have aruba and cucumber setup
4
+ So I don't have to do it myself
5
+
6
+ Scenario: App just runs
7
+ When I get help for "dfb"
8
+ Then the exit status should be 0
@@ -0,0 +1,6 @@
1
+ When /^I get help for "([^"]*)"$/ do |app_name|
2
+ @app_name = app_name
3
+ step %(I run `#{app_name} help`)
4
+ end
5
+
6
+ # Add more step definitions here
@@ -0,0 +1,15 @@
1
+ require 'aruba/cucumber'
2
+
3
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
4
+ LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
5
+
6
+ Before do
7
+ # Using "announce" causes massive warnings on 1.9.2
8
+ @puts = true
9
+ @original_rubylib = ENV['RUBYLIB']
10
+ ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
11
+ end
12
+
13
+ After do
14
+ ENV['RUBYLIB'] = @original_rubylib
15
+ end
@@ -0,0 +1,60 @@
1
+ require 'DictFlutterCommand/version.rb'
2
+
3
+ # Add requires for other files you add to your project here, so
4
+ # you just need to require this one file in your bin file
5
+ module DictFlutterCommand
6
+ # Your code goes here...
7
+ def self.hello
8
+ p "hello world"
9
+ system "hello world"
10
+ end
11
+
12
+ def self.clone
13
+ p "git clone ..."
14
+ system 'mkdir ~/YDDictFlutter; cd ~/YDDictFlutter;git clone git@gitlab.corp.youdao.com:luna-dev/dict-ios-flutter-bridge.git;'
15
+ system "cd ~/YDDictFlutter/dict-ios-flutter-bridge;git submodule init;git submodule update;"
16
+ end
17
+
18
+ def self.init_flutter
19
+ p "正在配置flutter环境"
20
+ system "sh install_flutter_env.sh"
21
+ end
22
+
23
+ def self.run_ios
24
+ #ideviceinstaller https://www.jianshu.com/p/92273e86ab2b
25
+ # system "pod install"
26
+ p "还没有实现"
27
+ end
28
+
29
+ def self.run_android
30
+ #https://blog.csdn.net/tymatlab/article/details/80989769
31
+ self.flutter_clean
32
+ self.pub_get
33
+ #打包
34
+ system "cd ~/YDDictFlutter/dict-ios-flutter-bridge/android_example;./gradlew assembleDebug;"
35
+ #装载,运行
36
+ system "cd ~/YDDictFlutter/dict-ios-flutter-bridge/android_example/app/build/outputs/apk/debug/;adb install -r app-debug.apk;adb shell am start -n com.example.android_example/com.youdao.flutter.FlutterBaseActivity;"
37
+
38
+ end
39
+
40
+ def self.attach
41
+ p "执行 flutter attach"
42
+ system "cd ~/YDDictFlutter/dict-ios-flutter-bridge/Embed/flutter_module;flutter attach;"
43
+ end
44
+
45
+ def self.create_package(packageName)
46
+ p "创建flutter package"
47
+ command = "cd ~/YDDictFlutter/dict-ios-flutter-bridge/Embed/flutter_module/Business;flutter create --template=package " + packageName
48
+ system command
49
+ p "~/YDDictFlutter/dict-ios-flutter-bridge/Embed/flutter_module/Business/" + "packageName"
50
+ end
51
+
52
+ def self.pub_get
53
+ system "cd ~/YDDictFlutter/dict-ios-flutter-bridge/Embed/flutter_module;sh flutter_pub_get.sh"
54
+ end
55
+
56
+ def self.flutter_clean
57
+ system "cd ~/YDDictFlutter/dict-ios-flutter-bridge/Embed/flutter_module;flutter clean;"
58
+ end
59
+
60
+ end
@@ -0,0 +1,3 @@
1
+ module Dfb
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class DefaultTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def teardown
9
+ end
10
+
11
+ def test_the_truth
12
+ assert true
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ require 'test/unit'
2
+
3
+ # Add test libraries you want to use here, e.g. mocha
4
+
5
+ class Test::Unit::TestCase
6
+
7
+ # Add global extensions to the test case class here
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dfb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Your Name Here
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-12-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: aruba
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: gli
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.19.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.19.0
69
+ description:
70
+ email: your@email.address.com
71
+ executables:
72
+ - dfb
73
+ extensions: []
74
+ extra_rdoc_files:
75
+ - README.rdoc
76
+ - dfb.rdoc
77
+ files:
78
+ - Gemfile
79
+ - README.rdoc
80
+ - Rakefile
81
+ - bin/dfb
82
+ - dfb.gemspec
83
+ - dfb.rdoc
84
+ - features/dfb.feature
85
+ - features/step_definitions/dfb_steps.rb
86
+ - features/support/env.rb
87
+ - lib/dfb.rb
88
+ - lib/dfb/version.rb
89
+ - test/default_test.rb
90
+ - test/test_helper.rb
91
+ homepage: http://your.website.com
92
+ licenses: []
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options:
96
+ - "--title"
97
+ - dfb
98
+ - "--main"
99
+ - README.rdoc
100
+ - "-ri"
101
+ require_paths:
102
+ - lib
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubygems_version: 3.0.6
116
+ signing_key:
117
+ specification_version: 4
118
+ summary: A description of your project
119
+ test_files: []