bomberstudios-fluby 0.5.7 → 0.5.8
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.
- data/README.mdown +29 -0
- data/Rakefile +5 -1
- data/lib/fluby.rb +33 -3
- data/lib/templates/README +1 -1
- data/lib/templates/Rakefile +7 -0
- metadata +2 -2
data/README.mdown
CHANGED
@@ -2,4 +2,33 @@
|
|
2
2
|
|
3
3
|
A simple command to create an empty ActionScript project for MTASC + SWFMILL + Rake
|
4
4
|
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
gem install fluby
|
8
|
+
|
9
|
+
Fluby requires the 'mtasc' and 'swfmill' executables somewhere on your path.
|
10
|
+
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
To create a new project:
|
15
|
+
|
16
|
+
fluby ProjectName
|
17
|
+
|
18
|
+
To compile your brand new project:
|
19
|
+
|
20
|
+
cd ProjectName
|
21
|
+
rake
|
22
|
+
|
23
|
+
That should generate a 'ProjectName.swf' file on the 'deploy' folder. The SWF file is debug-enabled (i.e: you can see the trace() output if you have a debug Flash Player). If you want to release your project without debug information, run
|
24
|
+
|
25
|
+
rake release
|
26
|
+
|
27
|
+
There are other rake tasks available:
|
28
|
+
|
29
|
+
rake package # Creates a ZIP file containing your SWF file on the 'pkg' folder
|
30
|
+
rake test # Opens a HTML file with your SWF for testing on your default browser (available on Mac only)
|
31
|
+
|
32
|
+
## Notes
|
33
|
+
|
5
34
|
This is a github copy of [the original project in Google Code](http://code.google.com/p/fluby/)
|
data/Rakefile
CHANGED
data/lib/fluby.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
module Fluby
|
2
2
|
NAME = 'fluby'
|
3
|
-
VERSION = '0.5.
|
3
|
+
VERSION = '0.5.8'
|
4
|
+
|
5
|
+
COLORS = {
|
6
|
+
:black => "\033[0;30m",
|
7
|
+
:red => "\033[0;31m",
|
8
|
+
:green => "\033[0;32m",
|
9
|
+
:yellow => "\033[0;33m",
|
10
|
+
:blue => "\033[0;34m",
|
11
|
+
:purple => "\033[0;35m",
|
12
|
+
:cyan => "\033[0;36m",
|
13
|
+
:white => "\033[0;37m",
|
14
|
+
:whitebold => "\033[1;37m"
|
15
|
+
}
|
4
16
|
|
5
17
|
def self.create_project(name)
|
6
18
|
require "fileutils"
|
@@ -10,10 +22,12 @@ module Fluby
|
|
10
22
|
@project_name = name
|
11
23
|
@project_folder = FileUtils.pwd + "/" + @project_name
|
12
24
|
|
25
|
+
puts "\n#{COLORS[:green]}Creating project #{@project_name}"
|
26
|
+
|
13
27
|
# Make folders
|
14
28
|
if File.exist? @project_folder
|
15
|
-
puts "Folder #{@project_name} already exists,"
|
16
|
-
puts "please choose a different name for your project"
|
29
|
+
puts "#{COLORS[:red]}Folder #{@project_name} already exists,"
|
30
|
+
puts "#{COLORS[:red]}please choose a different name for your project"
|
17
31
|
exit
|
18
32
|
end
|
19
33
|
FileUtils.mkdir [@project_folder,"#{@project_folder}/deploy","#{@project_folder}/assets"]
|
@@ -38,6 +52,7 @@ module Fluby
|
|
38
52
|
destination = source
|
39
53
|
end
|
40
54
|
FileUtils.cp "#{File.dirname(__FILE__)}/templates/#{source}", "#{@project_folder}/#{destination}"
|
55
|
+
log "#{@project_name}/#{destination}"
|
41
56
|
end
|
42
57
|
|
43
58
|
def self.render_template source, destination=nil
|
@@ -47,6 +62,21 @@ module Fluby
|
|
47
62
|
open("#{@project_folder}/#{destination}","w") do |f|
|
48
63
|
f << ERB.new(IO.read("#{File.dirname(__FILE__)}/templates/#{source}")).result(binding)
|
49
64
|
end
|
65
|
+
log "#{@project_name}/#{destination}"
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.log string
|
69
|
+
puts " #{COLORS[:white]}Creating #{COLORS[:cyan]}#{string}#{COLORS[:white]}"
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.in_textmate?
|
73
|
+
begin
|
74
|
+
if TextMate
|
75
|
+
return true
|
76
|
+
end
|
77
|
+
rescue
|
78
|
+
return false
|
79
|
+
end
|
50
80
|
end
|
51
81
|
|
52
82
|
def self.is_mac?
|
data/lib/templates/README
CHANGED
data/lib/templates/Rakefile
CHANGED
@@ -6,6 +6,7 @@ BGCOLOR = "#ffffff"
|
|
6
6
|
APP = "<%= @project_name %>"
|
7
7
|
|
8
8
|
require "erb"
|
9
|
+
require 'rake/packagetask'
|
9
10
|
|
10
11
|
def render_template(file)
|
11
12
|
filename = File.basename(file).split(".")[0]
|
@@ -47,6 +48,12 @@ task :compile do
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
51
|
+
Rake::PackageTask.new(APP, :noversion) do |p|
|
52
|
+
p.need_zip = true
|
53
|
+
p.name = Time.now.strftime("%Y%m%d") + "-" + APP
|
54
|
+
p.package_files.include("README",Dir["deploy/*"])
|
55
|
+
end
|
56
|
+
|
50
57
|
<% if Fluby.has_growl? %>
|
51
58
|
task :notify do
|
52
59
|
msg = "Finished compiling in #{@end - @start}s."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bomberstudios-fluby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Ale Mu\xC3\xB1oz"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|