myFlutter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +3 -19
- data/lib/myFlutter.rb +45 -9
- data/lib/myFlutter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29dbdb36df19e0b19a76b71c10c5f0317f0338b3d283822e0406c936d7a7e69f
|
4
|
+
data.tar.gz: b018d9affb7ef012a1abe9573e80ee27b89d42f79c11ff4d1f44fadb20b34527
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14dd16d6865df743c79bcc0b1e716eaa4132dabc54f79b3c15f9e0d908a34e55f99da4e7e849d19b3076931ce564ef3ce099ef6426b9fa510992e9c532742501
|
7
|
+
data.tar.gz: 6830f71426b2426f7baf7492082256e974284014d8803bc37304cae6679c7b22c92ac197a8a61ac37e4dbf942822ddb6aebfbca3df8f177e7a41c46b1b377414
|
data/.idea/workspace.xml
CHANGED
@@ -57,7 +57,7 @@
|
|
57
57
|
<configuration name="Unnamed" type="RubyRunConfigurationType" factoryName="Ruby" nameIsGenerated="true">
|
58
58
|
<module name="myFlutter" />
|
59
59
|
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="" />
|
60
|
-
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
|
60
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$/.." />
|
61
61
|
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="true" />
|
62
62
|
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="RVM: ruby-2.6.3" />
|
63
63
|
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
@@ -85,7 +85,7 @@
|
|
85
85
|
<option name="presentableId" value="Default" />
|
86
86
|
<updated>1572342499518</updated>
|
87
87
|
<workItem from="1572342500810" duration="26000" />
|
88
|
-
<workItem from="1572342596564" duration="
|
88
|
+
<workItem from="1572342596564" duration="7854000" />
|
89
89
|
</task>
|
90
90
|
<servers />
|
91
91
|
</component>
|
@@ -108,22 +108,6 @@
|
|
108
108
|
<component name="XDebuggerManager">
|
109
109
|
<breakpoint-manager>
|
110
110
|
<breakpoints>
|
111
|
-
<line-breakpoint enabled="true" type="ruby-line">
|
112
|
-
<url>file://$PROJECT_DIR$/lib/myFlutter.rb</url>
|
113
|
-
<line>6</line>
|
114
|
-
<properties a="-1">
|
115
|
-
<option name="block-ordinal" value="-1" />
|
116
|
-
</properties>
|
117
|
-
<option name="timeStamp" value="1" />
|
118
|
-
</line-breakpoint>
|
119
|
-
<line-breakpoint enabled="true" type="ruby-line">
|
120
|
-
<url>file://$PROJECT_DIR$/lib/myFlutter.rb</url>
|
121
|
-
<line>8</line>
|
122
|
-
<properties a="-1">
|
123
|
-
<option name="block-ordinal" value="-1" />
|
124
|
-
</properties>
|
125
|
-
<option name="timeStamp" value="2" />
|
126
|
-
</line-breakpoint>
|
127
111
|
<line-breakpoint enabled="true" type="ruby-line">
|
128
112
|
<url>file://$USER_HOME$/.rvm/gems/ruby-2.6.3/gems/myFlutter-0.2.0/lib/myFlutter.rb</url>
|
129
113
|
<line>15</line>
|
@@ -136,6 +120,6 @@
|
|
136
120
|
</breakpoint-manager>
|
137
121
|
</component>
|
138
122
|
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
139
|
-
<SUITE FILE_PATH="coverage/myFlutter@Unnamed.rcov" NAME="Unnamed Coverage Results" MODIFIED="
|
123
|
+
<SUITE FILE_PATH="coverage/myFlutter@Unnamed.rcov" NAME="Unnamed Coverage Results" MODIFIED="1572352790674" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/.." MODULE_NAME="myFlutter" />
|
140
124
|
</component>
|
141
125
|
</project>
|
data/lib/myFlutter.rb
CHANGED
@@ -5,17 +5,53 @@ module MyFlutter
|
|
5
5
|
class Tool < Thor
|
6
6
|
|
7
7
|
@@flutter_root = ENV['HOME']+'/flutter'
|
8
|
-
|
9
|
-
|
8
|
+
@@flutterSDK_url = "https://github.com/flutter/flutter.git"
|
9
|
+
|
10
|
+
desc "install" , "Install the flutter SDK . "
|
11
|
+
def install()
|
12
|
+
if File.exist?(@@flutter_root)
|
13
|
+
puts("flutterSDK 已经安装了")
|
14
|
+
else
|
15
|
+
Dir.chdir(ENV['HOME'])
|
16
|
+
puts("执行下载FLutter SDK")
|
17
|
+
`git clone #{@@flutterSDK_url}`
|
18
|
+
raise 'flutter sdk下载失败' unless $?.success?
|
19
|
+
puts("flutter SDK下载成功")
|
20
|
+
end
|
21
|
+
annotation = "#flutter settings\n"
|
22
|
+
path_setting = "export PATH=\"$PATH:#{@@flutter_root}/bin\"\n"
|
23
|
+
bash_profile_path = ENV['HOME']+'/.bash_profile'
|
24
|
+
if File.exist?("#{bash_profile_path}")
|
25
|
+
puts "Export the settings into #{bash_profile_path}"
|
26
|
+
content = File.readlines("#{bash_profile_path}")
|
27
|
+
bash_file = File.open(ENV['HOME']+'/.bash_profile', 'a')
|
28
|
+
bash_file << "\n" unless content.last.eql?("\n")
|
29
|
+
bash_file << "#{annotation}" unless content.include?("#{annotation}")
|
30
|
+
bash_file << "#{path_setting}" unless content.include?("#{path_setting}")
|
31
|
+
bash_file.close
|
32
|
+
end
|
33
|
+
|
34
|
+
zshrc_path = ENV['HOME']+'/.zshrc'
|
35
|
+
if File.exist?("#{zshrc_path}")
|
36
|
+
puts "Export the settings into #{zshrc_path}"
|
37
|
+
content = File.readlines("#{zshrc_path}")
|
38
|
+
zshrc = File.open(ENV['HOME']+'/.zshrc', 'a')
|
39
|
+
zshrc << "\n" unless content.last.eql?("\n")
|
40
|
+
zshrc << "#{annotation}" unless content.include?("#{annotation}")
|
41
|
+
zshrc << "#{path_setting}" unless content.include?("#{path_setting}")
|
42
|
+
zshrc.close
|
43
|
+
end
|
10
44
|
end
|
11
45
|
|
12
|
-
desc "
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
46
|
+
desc "uninstall", "Uninstall the Flutter SDK"
|
47
|
+
def uninstall()
|
48
|
+
if File.exist?("#{@@flutter_root}")
|
49
|
+
puts "deleting the flutter sdk..."
|
50
|
+
`rm -rf #{@@flutter_root}`
|
51
|
+
raise 'git clone failed' unless $?.success?
|
52
|
+
end
|
53
|
+
puts "Remove the exported flutter variables in ~/.bash_profile and ~/.zshrc, if not needed anymore."
|
19
54
|
end
|
55
|
+
|
20
56
|
end
|
21
57
|
end
|
data/lib/myFlutter/version.rb
CHANGED