dfb 1.1.0 → 1.1.1

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: 65647d5a508cfd5a87b71e613fd251592ba3d7877ef458e59821525ca26407b9
4
- data.tar.gz: f88be74eba4e6720be6b99f9830dde7fcbc6f8adf36bc312cd1fa1d014ea51a8
3
+ metadata.gz: f81b3f500087438651df8fb1300c9bfe3c3f107413adb1d92f26ef8481a39431
4
+ data.tar.gz: e6d6edb4b254ebfc2a080e0a1cd4d2b0b06e382ce439c6950f350c3dd41718ae
5
5
  SHA512:
6
- metadata.gz: c52fa0fed48acf050c6b05eb879819b699c68ffcec644295214274d18dcd215be891e4b356f7df74638fa764e886993098a3e6b3b451c504fde005aec853ecc8
7
- data.tar.gz: 70a1249913d55c256680083e3b69cfe56ecf63c875054b831632cc1df35796ec43ce7c562cf8de640f800efeecb5163a73b6eb3aff0204b4d0c4d2b6af43c7a0
6
+ metadata.gz: 688f8b8df3a3574b37f2c6a79f40ba4a7404f17e64eeaebb6982fd24b55c8763006dfc4fea336d1c6f33a1379f95c752baf91aa4653050be2c3967e703f4fe67
7
+ data.tar.gz: 7b9f0401ef3e90b9aefcdb41bca3fdb772a2f38999b4ff97fc100c6fdc00623c636b92855f0296c3fd215d3f702ebf9b326bbc87e44e04052f4ef9425d778886
data/dfb-1.0.7.gem ADDED
Binary file
data/dfb-1.0.8.gem ADDED
Binary file
data/dfb-1.0.9.gem ADDED
Binary file
data/dfb-1.1.0.gem ADDED
Binary file
data/dfb.gemspec CHANGED
@@ -1,5 +1,6 @@
1
1
  # Ensure we require the local version and not one we might have installed already
2
2
  require File.join([File.dirname(__FILE__),'lib','dfb','version.rb'])
3
+ require File.join([File.dirname(__FILE__),'lib','path_manager.rb'])
3
4
  spec = Gem::Specification.new do |s|
4
5
  s.name = 'dfb'
5
6
  s.version = Dfb::VERSION
@@ -10,7 +11,7 @@ spec = Gem::Specification.new do |s|
10
11
  s.summary = 'A description of your project'
11
12
  s.files = `git ls-files`.split("
12
13
  ")
13
- s.require_paths << 'lib'
14
+ s.require_paths = 'lib'
14
15
  s.extra_rdoc_files = ['README.rdoc','dfb.rdoc']
15
16
  s.rdoc_options << '--title' << 'dfb' << '--main' << 'README.rdoc' << '-ri'
16
17
  s.bindir = 'bin'
data/lib/YDImage ADDED
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+
5
+ module YDImagePath
6
+
7
+ def self.printAll(path, isdark = true)
8
+ system "mkdir " + path + "/image"
9
+ system "mkdir " + path + "/image/2.0x"
10
+ system "mkdir " + path + "/image/3.0x"
11
+ arr = Dir.children(path)
12
+ # puts arr
13
+ arr.each { |name|
14
+ # puts name
15
+ outputs = name.sub(/\..*/,"")
16
+ if File.ftype(path + "/" + name) == "directory"
17
+ next
18
+ end
19
+
20
+ if outputs =~ /(.*)@2x/ || outputs =~ /(.*)@3x/
21
+ if outputs =~ /(.*)@2x/
22
+ # puts outputs
23
+ FileUtils.cp(path + "/" + name, path + "/image/2.0x")
24
+ File.rename(path + "/image/2.0x/" + name, path + "/image/2.0x/" + name.sub(/\@2x/,isdark ? "_dark" : ""))
25
+ end
26
+
27
+ if outputs =~ /(.*)@3x/
28
+ # puts outputs
29
+ FileUtils.cp(path + "/" + name, path + "/image/3.0x")
30
+ File.rename(path + "/image/3.0x/" + name, path + "/image/3.0x/" + name.sub(/\@3x/, isdark ? "_dark" : "") )
31
+ end
32
+ else
33
+ FileUtils.cp(path + "/" + name, path + "/image")
34
+ if isdark
35
+ File.rename(path + "/image/" + name, path + "/image/" + name.sub(/\.png/, "_dark.png") )
36
+ end
37
+
38
+ puts "static const " + outputs + " = \"" + outputs + ".png\";"
39
+ end
40
+ }
41
+ arr.each { |name|
42
+ if File.ftype(path + "/" + name) == "directory"
43
+ next
44
+ end
45
+ name = name.sub(/\..*/,"")
46
+ if !(name =~ /(.*)@2x/ || name =~ /(.*)@3x/)
47
+ puts "var " + name + ";"
48
+ end
49
+
50
+ }
51
+ end
52
+
53
+ end
54
+
55
+ YDImagePath.printAll("/Users/chedch/Downloads/词典_单词本_切图/DarkMode",true)
data/lib/dfb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dfb
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/ruby
2
+
3
+
4
+ module PathManager
5
+
6
+ def self.inputPath(path)
7
+ if self.containsPath
8
+ puts "确定您的新路径?为" + path
9
+ puts "y/n"
10
+ val = gets
11
+ if val =~ /Y|y/
12
+ self.deletePathFile
13
+ self.storagePathFile(path)
14
+ return
15
+ else
16
+ p "结束"
17
+ return
18
+ end
19
+ end
20
+ self.storagePathFile(path)
21
+
22
+ end
23
+
24
+ def self.outputPath
25
+ return IO.readlines(self.pathFileName)[0]
26
+ end
27
+
28
+ def self.storagePathFile(path)
29
+ file = File.new(self.pathFileName,"w");
30
+ file << path
31
+ file.close;
32
+ puts "更改路径成功!路径为:" + path
33
+ end
34
+
35
+ def self.deletePathFile
36
+ File.delete(self.pathFileName)
37
+ end
38
+
39
+ def self.containsPath
40
+ if File.exists?(self.pathFileName)
41
+ puts '当前根目录: '
42
+ IO.foreach(self.pathFileName) { |c|
43
+ puts c
44
+ }
45
+ return true
46
+ else
47
+ puts "根目录不存在"
48
+ return false
49
+ end
50
+ end
51
+
52
+ def self.pathFileName
53
+ return "dfb_path_file"
54
+ end
55
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dfb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - chedechao
@@ -96,14 +96,20 @@ files:
96
96
  - dfb-1.0.4.gem
97
97
  - dfb-1.0.5.gem
98
98
  - dfb-1.0.6.gem
99
+ - dfb-1.0.7.gem
100
+ - dfb-1.0.8.gem
101
+ - dfb-1.0.9.gem
102
+ - dfb-1.1.0.gem
99
103
  - dfb.gemspec
100
104
  - dfb.rdoc
101
105
  - features/dfb.feature
102
106
  - features/step_definitions/dfb_steps.rb
103
107
  - features/support/env.rb
104
108
  - install_flutter_env.sh
109
+ - lib/YDImage
105
110
  - lib/dfb.rb
106
111
  - lib/dfb/version.rb
112
+ - lib/path_manager.rb
107
113
  - test/default_test.rb
108
114
  - test/test_helper.rb
109
115
  homepage: https://github.com/YoudaoMobile/DictFlutterCommand.git
@@ -118,7 +124,6 @@ rdoc_options:
118
124
  - "-ri"
119
125
  require_paths:
120
126
  - lib
121
- - lib
122
127
  required_ruby_version: !ruby/object:Gem::Requirement
123
128
  requirements:
124
129
  - - ">="