myFlutter 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb15de6499e05571162465fbd6ffa387ecec0e26826b670bee869cf27cb8d36c
4
- data.tar.gz: 54260fb23b45eb527f6c5f5549afd916b8e698362259097758f7e4ac420b5946
3
+ metadata.gz: 29dbdb36df19e0b19a76b71c10c5f0317f0338b3d283822e0406c936d7a7e69f
4
+ data.tar.gz: b018d9affb7ef012a1abe9573e80ee27b89d42f79c11ff4d1f44fadb20b34527
5
5
  SHA512:
6
- metadata.gz: 912a85b5660b1f05379d51cd5f0fa6c27f0401fab46b27b62db6aa5b9c30b98dc0bbbd64dab3366b832ab0d63e0f83d8c7a9425108f5a2ba893655860700d868
7
- data.tar.gz: 352d8a26bc90069a0614856e371ce9fa25d148203ad2ddcb66d809bc35b34ae4f7c7002605f44c22ca9b59c94da807e61270dbe388e283dea9fee1d72924b461
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="6557000" />
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="1572351493473" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" MODULE_NAME="myFlutter" />
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
- def self.flutter_root
9
- @@flutter_root
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 "install [version]" , "Install the flutter SDK . \n
13
- You can go to 'https://github.com/flutter/flutter/releases' to get the version you want . \n
14
- If no verion is defined,it will use 'v1.9.1+hotfix.6'"
15
- option :'version', :type => :string, :default => 'v1.9.1+hotfix.6'
16
- option :'auto-dotfiles', :type => :boolean, :default => false
17
- def install(version)
18
- puts(version)
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
@@ -1,3 +1,3 @@
1
1
  module MyFlutter
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myFlutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - 普洱茶