jasmine-jstd-conf 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in jasmine-jstd-conf.gemspec
4
+ gemspec
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ (The MIT license)
2
+
3
+ Copyright (C) 2012 Hedgeye Risk Management
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,28 @@
1
+ = jasmine-jstd-conf
2
+
3
+ Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
4
+
5
+ == Tutorial
6
+
7
+ Usage: jasmine-jstd-conf path [--help]
8
+
9
+ path Path to write to.
10
+ --help Show this help text.
11
+
12
+ Based on jasmine.yml, write a JSTD config file to the supplied path.
13
+
14
+ Example:
15
+
16
+ $ bin/jasmine-jstd-conf jsTestDriver.conf
17
+ $ cat jsTestDriver.conf
18
+ server: http://localhost:9876
19
+
20
+ load:
21
+ - ../jasmine/lib/jasmine.js
22
+ - spec/javascripts/support/JasmineAdapter.js
23
+ - spec/javascripts/helpers/jasmine-jquery-1.3.1.js
24
+ - spec/javascripts/FooSpec.js
25
+ - spec/javascripts/BarSpec.js
26
+ - spec/javascripts/BazSpec.js
27
+ - spec/javascripts/QuxSpec.js
28
+ # [...]
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'jasmine-jstd-conf'
3
+
4
+ if ARGV.include?('--help')
5
+ Jasmine::JSTD::Conf.show_usage
6
+ elsif filename = ARGV[0]
7
+ Jasmine::JSTD::Conf.write(filename)
8
+ else
9
+ Jasmine::JSTD::Conf.show_usage
10
+ end
data/configure ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ # Set up build environment
3
+ #
4
+ # @see http://en.wikipedia.org/wiki/Configure_script
5
+ set -o errexit
6
+
7
+ gem install bundler --version "~> 1.0" --no-rdoc --no-ri
8
+ bundle install
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "jasmine-jstd-conf/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "jasmine-jstd-conf"
7
+ s.version = Jasmine::JSTD::Conf::VERSION
8
+ s.authors = ["Benjamin Oakes"]
9
+ s.email = ["boakes@hedgeye.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Based on jasmine.yml, write a jsTestDriver config file to the supplied path.}
12
+ s.description = s.summary
13
+
14
+ s.rubyforge_project = "jasmine-jstd-conf"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency('jasmine')
22
+ s.add_dependency('mustache', '~> 0.99.4')
23
+
24
+ s.add_development_dependency('bundler', '~> 1.0.0')
25
+ s.add_development_dependency('rake', '~> 0.8.7')
26
+ s.add_development_dependency('yard', '< 1.0.0')
27
+ end
@@ -0,0 +1,76 @@
1
+ require "jasmine-jstd-conf/version"
2
+ require 'rubygems'
3
+ require 'jasmine'
4
+ require 'mustache'
5
+
6
+ module Jasmine
7
+ module JSTD
8
+ module Conf
9
+ # This looks like YAML, but it's hard to be sure...
10
+ TEMPLATE = <<EOF
11
+ server: {{server}}
12
+
13
+ load:
14
+ {{#paths}}
15
+ - {{.}}
16
+ {{/paths}}
17
+ EOF
18
+
19
+ def self.map(doc)
20
+ paths = [
21
+ '../jasmine/lib/jasmine.js',
22
+ 'spec/javascripts/support/JasmineAdapter.js',
23
+ ]
24
+
25
+ paths.concat(doc.js_files)
26
+
27
+ paths.map! do |path|
28
+ path.
29
+ gsub(%r{^/}, '').
30
+ gsub('__spec__', 'spec/javascripts')
31
+ end
32
+
33
+ {
34
+ :server => 'http://localhost:9876',
35
+ :paths => paths,
36
+ }
37
+ end
38
+
39
+ def self.render
40
+ Mustache.render(TEMPLATE, map(Jasmine::Config.new))
41
+ end
42
+
43
+ def self.write(path)
44
+ File.open(path, 'w') { |f| f.puts render }
45
+ end
46
+
47
+ def self.show_usage
48
+ puts <<EOF
49
+ Usage: #{$PROGRAM_NAME} path [--help]
50
+
51
+ path Path to write to.
52
+ --help Show this help text.
53
+
54
+ Based on jasmine.yml, write a JSTD config file to the supplied path.
55
+
56
+ Example:
57
+
58
+ $ #{$PROGRAM_NAME} jsTestDriver.conf
59
+ $ cat jsTestDriver.conf
60
+ server: http://localhost:9876
61
+
62
+ load:
63
+ - ../jasmine/lib/jasmine.js
64
+ - spec/javascripts/support/JasmineAdapter.js
65
+ - spec/javascripts/helpers/jasmine-jquery-1.3.1.js
66
+ - spec/javascripts/FooSpec.js
67
+ - spec/javascripts/BarSpec.js
68
+ - spec/javascripts/BazSpec.js
69
+ - spec/javascripts/QuxSpec.js
70
+ # [...]
71
+ EOF
72
+ exit -1
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,7 @@
1
+ module Jasmine
2
+ module JSTD
3
+ module Conf
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jasmine-jstd-conf
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Benjamin Oakes
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-01-26 00:00:00 -05:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: jasmine
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: mustache
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 0.99.4
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: bundler
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 1.0.0
47
+ type: :development
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: rake
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: 0.8.7
58
+ type: :development
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: yard
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - <
67
+ - !ruby/object:Gem::Version
68
+ version: 1.0.0
69
+ type: :development
70
+ version_requirements: *id005
71
+ description: Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
72
+ email:
73
+ - boakes@hedgeye.com
74
+ executables:
75
+ - jasmine-jstd-conf
76
+ extensions: []
77
+
78
+ extra_rdoc_files: []
79
+
80
+ files:
81
+ - .gitignore
82
+ - Gemfile
83
+ - MIT-LICENSE
84
+ - README.rdoc
85
+ - Rakefile
86
+ - bin/jasmine-jstd-conf
87
+ - configure
88
+ - jasmine-jstd-conf.gemspec
89
+ - lib/jasmine-jstd-conf.rb
90
+ - lib/jasmine-jstd-conf/version.rb
91
+ has_rdoc: true
92
+ homepage: ""
93
+ licenses: []
94
+
95
+ post_install_message:
96
+ rdoc_options: []
97
+
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: "0"
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: "0"
112
+ requirements: []
113
+
114
+ rubyforge_project: jasmine-jstd-conf
115
+ rubygems_version: 1.5.2
116
+ signing_key:
117
+ specification_version: 3
118
+ summary: Based on jasmine.yml, write a jsTestDriver config file to the supplied path.
119
+ test_files: []
120
+