mercury 0.6.0 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/Mercury.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mercury}
8
- s.version = "0.6.0"
8
+ s.version = "0.7.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tom Wilson"]
12
- s.date = %q{2010-03-04}
12
+ s.date = %q{2010-03-05}
13
13
  s.default_executable = %q{mercury}
14
14
  s.description = %q{Mercury allows you to create directory and start writting haml, html, css, etc to build wireframes for your user design.}
15
15
  s.email = %q{thing2@jackhq.com}
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "bin/mercury",
30
30
  "lib/mercury.rb",
31
31
  "lib/public/favicon.ico",
32
+ "lib/public/images/bk_gradient.png",
32
33
  "lib/public/javascripts/jquery-1.4.2.min.js",
33
34
  "lib/public/javascripts/jquery-ui-1.8rc3.custom.min.js",
34
35
  "lib/public/stylesheets/960.css",
@@ -51,6 +52,7 @@ Gem::Specification.new do |s|
51
52
  "lib/public/stylesheets/text.css",
52
53
  "lib/views/index.haml",
53
54
  "lib/views/layout.haml",
55
+ "mercury-0.7.2.gem",
54
56
  "spec/mercury_spec.rb",
55
57
  "spec/spec.opts",
56
58
  "spec/spec_helper.rb"
data/README.rdoc CHANGED
@@ -1,13 +1,16 @@
1
1
  = Mercury
2
2
 
3
- Mercury is a command line application that makes it dirt simple to create
4
- html forms(wireframes) using the following technology:
3
+ Mercury is a prototype builder:
4
+
5
+ === Technology
5
6
 
6
7
  * haml
7
8
  * sass
8
9
  * jquery
9
10
  * jquery-ui
10
11
 
12
+ * BluePrint
13
+
11
14
  == Why
12
15
 
13
16
  Using textmate, haml, sass, and jquery to create slick ui designs is a great and fluid process.
@@ -27,7 +30,7 @@ So with mercury you use the haml, jquery, jquery-ui, with just a simple command.
27
30
 
28
31
  mercury [project]
29
32
 
30
- # Create your erb or haml files
33
+ # Create your haml files
31
34
 
32
35
  cd views
33
36
 
@@ -86,7 +89,7 @@ So with mercury you use the haml, jquery, jquery-ui, with just a simple command.
86
89
 
87
90
  # now in your haml file simply
88
91
 
89
- = sass '/test.sass'
92
+ = sass :test
90
93
 
91
94
  ===Using Javascript
92
95
 
@@ -100,7 +103,7 @@ So with mercury you use the haml, jquery, jquery-ui, with just a simple command.
100
103
 
101
104
  # now in your haml file simply
102
105
 
103
- = javascript '/test.js'
106
+ = javascript :test
104
107
 
105
108
 
106
109
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.3
data/bin/mercury CHANGED
@@ -8,10 +8,12 @@ version = ">= 0"
8
8
  if ARGV.first
9
9
  # Build Directory and add setup files
10
10
  FileUtils.mkdir_p ARGV.first
11
- FileUtils.mkdir_p ARGV.first + '/views'
12
- File.open(ARGV.first + '/config.ru','w').write("require 'mercury'\nrun Mercury\n")
13
-
11
+ FileUtils.mkdir_p File.join(ARGV.first, 'views')
12
+ config_ru = ["require 'mercury'","log = File.new('mercury.log', 'a+')", $stdout.reopen(log), $stderr.reopen(log), "run Mercury"].join("\n")
13
+ File.open(File.join(ARGV.first, 'config.ru'),'w').write(config_ru)
14
14
  else
15
+ puts "Running Mercury on port:9292"
16
+ puts "Press Ctrl-C to exit"
15
17
  # try to run in current directory
16
18
  gem 'rack', version
17
19
  load Gem.bin_path('rack', 'rackup', version)
data/lib/mercury.rb CHANGED
@@ -5,24 +5,37 @@ require 'fileutils'
5
5
  require 'faker'
6
6
 
7
7
  class Mercury < Sinatra::Application
8
+ SASS = 'sass'
9
+ JS = 'js'
10
+
8
11
  set :root, FileUtils.pwd.gsub("\n",'')
9
12
  set :public, File.dirname(__FILE__) + '/public'
10
13
 
11
14
  get '/*' do
12
- unless params["splat"][0].empty?
13
- haml params["splat"][0].to_sym, :layout => open(File.dirname(__FILE__) + '/views/layout.haml','r').read
14
- else
15
- haml open(File.dirname(__FILE__) + '/views/index.haml','r').read, :layout => open(File.dirname(__FILE__) + '/views/layout.haml','r').read
16
- end
15
+ vf = params["splat"][0]
16
+ vd = File.join(File.dirname(__FILE__),'views')
17
+ layout_template = open(File.join(vd,'layout.haml'),'r').read
18
+
19
+ view_file = vf.empty? ? open(File.join(vd,'index.haml'),'r').read : vf.to_sym
20
+
21
+ haml view_file, :layout => layout_template
17
22
  end
18
23
 
19
24
  def sass(sassfile)
20
- "<style type='text/css'>\n" + Sass::Engine.new(open(options.views + sassfile, 'r').read).render + "\n</style>\n"
25
+ ["<style type='text/css'>",
26
+ Sass::Engine.new(open(find_file(sassfile, SASS), 'r').read).render,
27
+ "</style>\n"].join("\n")
21
28
  end
22
29
 
23
30
  def javascript(jsfile)
24
- "<script type='text/javascript'>\n" + open(options.views + jsfile, 'r').read + "\n</script>\n"
31
+ ["<script type='text/javascript'>",
32
+ open(find_file(jsfile, JS), 'r').read,
33
+ "</script>\n"].join("\n")
25
34
  end
26
35
 
36
+ private
37
+ def find_file(filename, ext)
38
+ Dir.glob(File.join(options.views, "**/*.#{ext}")).select { |f| f =~ /#{filename}.#{ext}$/ }.first
39
+ end
27
40
 
28
41
  end
Binary file
@@ -3,6 +3,12 @@
3
3
  color:#4C4C4C;
4
4
  }
5
5
 
6
+ #tool-footer a {
7
+ text-decoration:none;
8
+ color:#4C4C4C;
9
+
10
+ }
11
+
6
12
  input.text, input.title, textarea, select {margin:0.5em 0;border:1px solid #bbb;}
7
13
  input.text:focus, input.title:focus, textarea:focus, select:focus {border:1px solid #666;}
8
14
  input.text, input.title {width:300px;padding:5px;}
data/lib/views/index.haml CHANGED
@@ -1,6 +1,14 @@
1
1
  :erb
2
2
  <style type="text/css">
3
3
  :sass
4
+ #header-wrap
5
+ background: transparent url(/images/bk_gradient.png) repeat-x
6
+ color: white
7
+
8
+ #header
9
+ h1
10
+ margin-left: 15px
11
+
4
12
  ul#pages
5
13
  list-style: none
6
14
  li
@@ -14,22 +22,26 @@
14
22
  :javascript
15
23
  $(function() {
16
24
  $('#pages').children().mouseover(function(){
17
- $(this).css('background-color','yellow');
25
+ $(this).css('background-image','url(/images/bk_gradient.png)');
18
26
  });
19
27
  $('#pages').children().mouseout(function(){
20
- $(this).css('background-color','transparent');
28
+ $(this).css('background-image','none');
21
29
  });
22
30
  $('#pages').children().click(function(){
23
31
  window.location = $(this).attr('data-href');
24
32
  });
25
33
 
26
34
  })
27
- #wrap.grid_16
28
- %h2 Wireframe Mockups
35
+ #header-wrap
36
+ #header.container_16
37
+ %h1 Mercury
38
+
39
+ #wrap.container_16
40
+ %h2 Projects
29
41
  %ul#pages
30
- - Dir.glob('views/**/*.haml').each do |f|
42
+ - Dir.glob('views/*/').each do |f|
31
43
  - unless f =~ /index/ or f =~ /layout/
32
- %li{:'data-href' => f.gsub(/views/,'').match(/(.*).haml$/)[1]}= f.match(/\/(.*).haml$/)[1]
44
+ %li{:'data-href' => f.gsub(/views/,'').match(/(.*)$/)[1] + 'default'}= f.match(/\/(.*)\/$/)[1]
33
45
 
34
46
 
35
47
 
@@ -8,12 +8,12 @@
8
8
  - ['jquery-1.4.2.min', 'jquery-ui-1.8rc3.custom.min'].each do |js|
9
9
  %script{:src => "/javascripts/#{js}.js", :type => 'text/javascript'}
10
10
 
11
- .container_16
12
- = yield
11
+ = yield
13
12
  #tool-footer.container_12
14
13
  .grid_8
15
14
  %p
16
- Mercury
15
+ %a{:href => '/'} Mercury
17
16
  .grid_4
18
- %p Jack Russell Software Company, LLC
17
+ %p
18
+ %a{:href => 'http://www.jackhq.com'} Jack Russell Software Company, LLC
19
19
  .clear
data/mercury-0.7.2.gem ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercury
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Wilson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-04 00:00:00 -05:00
12
+ date: 2010-03-05 00:00:00 -05:00
13
13
  default_executable: mercury
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -62,6 +62,7 @@ files:
62
62
  - bin/mercury
63
63
  - lib/mercury.rb
64
64
  - lib/public/favicon.ico
65
+ - lib/public/images/bk_gradient.png
65
66
  - lib/public/javascripts/jquery-1.4.2.min.js
66
67
  - lib/public/javascripts/jquery-ui-1.8rc3.custom.min.js
67
68
  - lib/public/stylesheets/960.css
@@ -84,6 +85,7 @@ files:
84
85
  - lib/public/stylesheets/text.css
85
86
  - lib/views/index.haml
86
87
  - lib/views/layout.haml
88
+ - mercury-0.7.2.gem
87
89
  - spec/mercury_spec.rb
88
90
  - spec/spec.opts
89
91
  - spec/spec_helper.rb