lfd 0.0.5 → 0.1.0

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/bin/lfd +3 -2
  3. data/lib/lfd.rb +4 -116
  4. data/lib/lfd_version.rb +1 -1
  5. metadata +51 -32
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f4ce85aaaba42163a9852ae64239f5e093d8aade
4
+ data.tar.gz: 3068d2725b514cc53ca3aa5141da23135a4f84bd
5
+ SHA512:
6
+ metadata.gz: 5399aa29fb4eb399c600ecdbc6bfad668bad6c988bcc30ca8d6abd74ad7c075447aedc3355ede10606b96ad5eeb5713bcdef8db78fafda295e07992e97d9c4b0
7
+ data.tar.gz: 09ff11b23084fa6f6cc1d1729a7cf49f731fcc870acc841576b3e5b6649dfd009c77d37b1d1094dcc217e482d1ce223db85455f5f92b55e075d6001232ca43a5
data/bin/lfd CHANGED
@@ -31,14 +31,15 @@ version Lfd::VERSION
31
31
  :run => 'run built swf file with debugger version of flash player',
32
32
  :test => 'build and run current project',
33
33
  :release => 'build binary swf of release version',
34
- :clean => 'remove files in current directory that were added by LFD'
34
+ :clean => 'remove files in current directory that were added by LFD',
35
+ :env => 'check the flash developing environment'
35
36
 
36
37
  }.each do |cmd, text|
37
38
 
38
39
  desc text
39
40
  command cmd do |c|
40
41
  c.action do
41
- LFD.new.send(cmd)
42
+ LFD::App.new.send(cmd)
42
43
  end
43
44
  end
44
45
 
data/lib/lfd.rb CHANGED
@@ -1,120 +1,8 @@
1
1
  # -*- encoding:utf-8
2
2
  require 'yaml'
3
3
  require 'fileutils'
4
+ require 'open3'
5
+ require 'colored'
6
+ require 'shellwords'
4
7
 
5
- class LFD
6
-
7
- CONFIG_FILE = 'asproj.info'
8
- MXMLC = ENV['MXMLC'] || 'mxmlc'
9
- FLASH_PLAYER = ENV['FLASH_PLAYER'] || 'flashplayer'
10
- TRACE_LOG = File.join ENV['HOME'], '/.macromedia/Flash_Player/Logs/flashlog.txt'
11
- CONFIG_SAMPLE = File.expand_path("../#{CONFIG_FILE}.sample", __FILE__)
12
- MM_CFG = File.join ENV['HOME'], '/mm.cfg'
13
-
14
- def setup(opt={})
15
- install_flex_sdk
16
- install_flash_player
17
- end
18
-
19
- def init(opt={})
20
- FileUtils.cp CONFIG_SAMPLE, CONFIG_FILE
21
- FileUtils.mkdir_p %w(bin lib src tmp)
22
- end
23
-
24
- def build(opt={})
25
- if File.exist?(CONFIG_FILE)
26
- info = YAML.load_file(CONFIG_FILE)
27
- args = build_arg(info, opt)
28
- system MXMLC, info["main"], *args
29
- raise "build_fail" if $?.exitstatus != 0
30
- else
31
- puts "#{CONFIG_FILE} not found, exiting"
32
- exit
33
- end
34
- end
35
-
36
- def test
37
- build
38
- run
39
- end
40
-
41
- def release(opt=Hash.new)
42
- build :debug => false
43
- end
44
-
45
- def run(opt={})
46
- check_tracelog_config
47
- empty_tracelog
48
- info = YAML.load_file(CONFIG_FILE)
49
- swf = File.expand_path(info["output"]["file"], FileUtils.pwd)
50
- player = fork { exec "#{FLASH_PLAYER} #{swf} 2> /dev/null"}
51
- tracer = fork { exec "tail", "-f", TRACE_LOG }
52
- Process.detach tracer
53
- Process.wait
54
- Process.kill "HUP", tracer
55
- end
56
-
57
- def clean(opt={})
58
- FileUtils.rm_f CONFIG_FILE
59
- FileUtils.rmdir %w(bin lib src tmp)
60
- end
61
-
62
- private
63
- def install_flex_sdk
64
- end
65
-
66
- def install_flash_player
67
- end
68
-
69
- public
70
- def check_tracelog_config
71
- if File.exist?(MM_CFG)
72
- File.open(MM_CFG, 'r+') do |file|
73
- cfg = {}
74
- file.each do |line|
75
- opt = line.split('=')
76
- cfg[opt[0]] = opt[1].chomp
77
- end
78
- cfg["ErrorReportingEnable"]="1"
79
- cfg["TraceOutputFileEnable"]="1"
80
- str = cfg.inject("") { |s,o| "#{s}#{o[0]}=#{o[1]}\n" }
81
- file.rewind
82
- file.write str
83
- end
84
- else
85
- File.open(MM_CFG, 'w') do |file|
86
- file.puts("ErrorReportingEnable=1\nTraceOutputFileEnable=1")
87
- end
88
- end
89
- end
90
-
91
- private
92
- def empty_tracelog
93
- system "echo '' > #{TRACE_LOG}"
94
- end
95
-
96
- def build_arg(info, opt={})
97
- ot = info["output"]
98
- args = [
99
- "--target-player=#{info["target"]}",
100
- "--output=#{ot["file"]}",
101
- "--source-path=#{array_opt_to_s info["source"]}",
102
- "--debug=#{opt[:debug] != false}",
103
- "-static-link-runtime-shared-libraries=true"
104
- # TODO: 加上更多的编译选项
105
- ]
106
- info["library"].each { |lib| args << "--library-path+=#{lib}" }
107
- w, h = ot["width"], ot["height"]
108
- args << "--default-size=#{w},#{h}" if w and h
109
- args
110
- end
111
-
112
- def array_opt_to_s(src)
113
- if Array === src
114
- src.join(',')
115
- else
116
- src.to_s
117
- end
118
- end
119
-
120
- end
8
+ require 'lfd/app'
@@ -1,3 +1,3 @@
1
1
  module Lfd
2
- VERSION = '0.0.5'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,53 +1,73 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lfd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - qhwa
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-03 00:00:00.000000000 Z
11
+ date: 2014-06-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
- requirement: &20727680 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *20727680
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rdoc
27
- requirement: &20726720 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *20726720
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: gli
38
- requirement: &20725920 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
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: colored
57
+ requirement: !ruby/object:Gem::Requirement
40
58
  requirements:
41
- - - ! '>='
59
+ - - ">="
42
60
  - !ruby/object:Gem::Version
43
61
  version: '0'
44
62
  type: :runtime
45
63
  prerelease: false
46
- version_requirements: *20725920
47
- description: ! ' LFD, which stands for "Linux Flash Develop", will help you develop
48
- Flash and Flex applications on Linux.
49
-
50
- '
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: |2
70
+ LFD, which stands for "Linux Flash Develop", will help you develop Flash and Flex applications on Linux.
51
71
  email: qhwa@163.com
52
72
  executables:
53
73
  - lfd
@@ -56,40 +76,39 @@ extra_rdoc_files:
56
76
  - README.rdoc
57
77
  - lfd.rdoc
58
78
  files:
59
- - bin/lfd
60
- - lib/lfd_version.rb
61
- - lib/lfd.rb
62
- - lib/asproj.info.sample
63
79
  - README.rdoc
80
+ - bin/lfd
64
81
  - lfd.rdoc
82
+ - lib/asproj.info.sample
83
+ - lib/lfd.rb
84
+ - lib/lfd_version.rb
65
85
  homepage: https://github.com/qhwa/LFD
66
86
  licenses: []
87
+ metadata: {}
67
88
  post_install_message:
68
89
  rdoc_options:
69
- - --title
90
+ - "--title"
70
91
  - lfd
71
- - --main
92
+ - "--main"
72
93
  - README.rdoc
73
- - -ri
94
+ - "-ri"
74
95
  require_paths:
75
96
  - lib
76
97
  - lib
77
98
  required_ruby_version: !ruby/object:Gem::Requirement
78
- none: false
79
99
  requirements:
80
- - - ! '>='
100
+ - - ">="
81
101
  - !ruby/object:Gem::Version
82
102
  version: '0'
83
103
  required_rubygems_version: !ruby/object:Gem::Requirement
84
- none: false
85
104
  requirements:
86
- - - ! '>='
105
+ - - ">="
87
106
  - !ruby/object:Gem::Version
88
107
  version: '0'
89
108
  requirements: []
90
109
  rubyforge_project:
91
- rubygems_version: 1.8.17
110
+ rubygems_version: 2.2.2
92
111
  signing_key:
93
- specification_version: 3
112
+ specification_version: 4
94
113
  summary: Flash develop tool on Linux
95
114
  test_files: []