dfb 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +2 -0
- data/README.rdoc +6 -0
- data/Rakefile +44 -0
- data/bin/dfb +136 -0
- data/dfb.gemspec +22 -0
- data/dfb.rdoc +5 -0
- data/features/dfb.feature +8 -0
- data/features/step_definitions/dfb_steps.rb +6 -0
- data/features/support/env.rb +15 -0
- data/lib/dfb.rb +60 -0
- data/lib/dfb/version.rb +3 -0
- data/test/default_test.rb +14 -0
- data/test/test_helper.rb +9 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 26c105b0d2dd5525135a4a2007b0f59c743196ba9a4246da5eed0b7d8dc30888
|
4
|
+
data.tar.gz: c713cae6a0e85c2298e00cef448fa2f848316962bcf682483def5f0ef761b96d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7548c2d4f0234ba6bcbe6ca4cca4ab48861facfac03e2d6eb0a00349b416a7d3bbaa69174537961235b1402b5e32e7c010e7871c4237d0f74a3bf238e69e19c0
|
7
|
+
data.tar.gz: 6ee63054eeaeb65c361e04675a4a017be8c60a6236a008bc75b04cc1bf10fc1ae037434dc5dbc133c5c0d4a8068f6889bf54d3310510c9d743fe415be46503f1
|
data/Gemfile
ADDED
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -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 'dfb'
|
5
|
+
# rescue LoadError
|
6
|
+
# STDERR.puts "In development, you need to use `bundle exec bin/dfb` 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/dfb now"
|
9
|
+
# exit 64
|
10
|
+
# end
|
11
|
+
|
12
|
+
class App
|
13
|
+
extend GLI::App
|
14
|
+
|
15
|
+
program_desc '词典flutter工程管理命令'
|
16
|
+
|
17
|
+
version Dfb::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
|
+
Dfb.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
|
+
Dfb.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
|
+
Dfb.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
|
+
Dfb.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
|
+
Dfb.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
|
+
Dfb.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
|
+
Dfb.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
|
+
Dfb.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)
|
data/dfb.gemspec
ADDED
@@ -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
|
data/dfb.rdoc
ADDED
@@ -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
|
data/lib/dfb.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'dfb/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 Dfb
|
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
|
data/lib/dfb/version.rb
ADDED
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dfb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
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: []
|