boojs 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +61 -0
- data/Rakefile +36 -0
- data/bin/boojs +28 -0
- data/boojs +25 -0
- data/boojs.gemspec +24 -0
- data/lib/boo.js +2 -0
- data/lib/boojs/version.rb +3 -0
- data/logo.png +0 -0
- metadata +71 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6478d4484f4644e3c29b463e762561a57dbbdfff
|
4
|
+
data.tar.gz: 9daed02ed8455f0367173eb332b4cd75a8b8f9b6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6571cc90e52813fa83ab385527db9c5130e23fcfe6ef7891b9ddfc58d8d2b996e64051e4e6144663bf15747855286b72b7c415d0239f0694213f7b1a1181e849
|
7
|
+
data.tar.gz: 9213ee8e212da6fbb191c304a3a583caa479fcb887be1a3765b579cfebe979a32d12b4daf6a8f4bb74b990f184bcdafc11767747da2877210b9610e794ec1151
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
.run
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Seo Townsend
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do 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.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
![boojs: A unix tool to execute headless browser javascript](https://raw.githubusercontent.com/sotownsend/boojs/master/logo.png)
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/BooJS.svg)](http://badge.fury.io/rb/boojs)
|
4
|
+
[![Build Status](https://travis-ci.org/sotownsend/BooJS.svg?branch=master)](https://travis-ci.org/sotownsend/boojs)
|
5
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/sotownsend/BooJS/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
6
|
+
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/sotownsend/BooJS/blob/master/LICENSE)
|
7
|
+
|
8
|
+
# What is this?
|
9
|
+
A simple tool that allows you to execute javascript in the command line as if you were in a browser. Built on-top of [PhantomJS](phantomjs.org) and
|
10
|
+
addresess it's shortcomings as a unix tool.
|
11
|
+
|
12
|
+
```sh
|
13
|
+
#Setup
|
14
|
+
gem install boojs
|
15
|
+
```
|
16
|
+
|
17
|
+
# Usage
|
18
|
+
```sh
|
19
|
+
boojs [-v file]
|
20
|
+
```
|
21
|
+
|
22
|
+
There are two modes of operating.
|
23
|
+
|
24
|
+
|
25
|
+
1. If you pass the `-v` flag with a file, boojs will `validate` the javascript file you passed. If it contains any syntax errors, or anything that would crash the execution of the javascript file, these are caught here. Useful for unit tests to make sure the JS files are executable. It will return 0 if the file and not 0 if otherwise
|
26
|
+
|
27
|
+
2. If you do not pass the `-v` flag, boojs will accept JS input from stdin and emit JS output on stdout. If there is an exception, boojs
|
28
|
+
will output the exception to stderr and return not 0. In all other cases, boojs will not exit and you must send SIGINT to the process.
|
29
|
+
|
30
|
+
|
31
|
+
## Requirements
|
32
|
+
|
33
|
+
- Ruby 2.1 or Higher
|
34
|
+
|
35
|
+
## Communication
|
36
|
+
|
37
|
+
- If you **found a bug**, submit a pull request.
|
38
|
+
- If you **have a feature request**, submit a pull request.
|
39
|
+
- If you **want to contribute**, submit a pull request.
|
40
|
+
|
41
|
+
---
|
42
|
+
|
43
|
+
## FAQ
|
44
|
+
|
45
|
+
### When should I use boojs?
|
46
|
+
|
47
|
+
When you need to test javascript code that needs to run in a browser but don't necessarily need to test the UI components.
|
48
|
+
|
49
|
+
### What's Fittr?
|
50
|
+
|
51
|
+
Fittr is a SaaS company that focuses on providing personalized workouts and health information to individuals and corporations through phenomenal interfaces and algorithmic data-collection and processing.
|
52
|
+
|
53
|
+
* * *
|
54
|
+
|
55
|
+
### Creator
|
56
|
+
|
57
|
+
- [Seo Townsend](http://github.com/sotownsend) ([@seotownsend](https://twitter.com/seotownsend))
|
58
|
+
|
59
|
+
## License
|
60
|
+
|
61
|
+
boojs is released under the MIT license. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'rspec/core/rake_task'
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
# Default directory to look in is `/specs`
|
5
|
+
# Run with `rake spec`
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
task :default => :spec
|
9
|
+
|
10
|
+
#Upgrade version of gem
|
11
|
+
def upgrade_version
|
12
|
+
versionf = './lib/boojs/version.rb'
|
13
|
+
require versionf
|
14
|
+
|
15
|
+
#Upgrade version '0.0.1' => '0.0.2'
|
16
|
+
version = BooJS::VERSION
|
17
|
+
new_version = version.split(".")
|
18
|
+
new_version[2] = new_version[2].to_i + 1
|
19
|
+
new_version = new_version.join(".")
|
20
|
+
|
21
|
+
sreg = "s/#{version}/#{new_version}/"
|
22
|
+
puts `sed #{sreg} #{versionf} > tmp; cp tmp #{versionf}`
|
23
|
+
|
24
|
+
return new_version
|
25
|
+
end
|
26
|
+
|
27
|
+
task :push do
|
28
|
+
version = upgrade_version
|
29
|
+
`git add .`
|
30
|
+
`git commit -a -m 'gem #{version}'`
|
31
|
+
`git push`
|
32
|
+
`git tag #{version}`
|
33
|
+
`git push origin #{version}`
|
34
|
+
`gem build boojs.gemspec`
|
35
|
+
`gem push boojs-#{version}.gem`
|
36
|
+
end
|
data/bin/boojs
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'gocd-slack-server'
|
3
|
+
|
4
|
+
gocd_addr = ARGV[0]
|
5
|
+
slack_hook = ARGV[1]
|
6
|
+
bot_name = ARGV[2]
|
7
|
+
user_pass = ARGV[3]
|
8
|
+
|
9
|
+
def usage
|
10
|
+
puts "-------------------------------------------------------------------------------------------"
|
11
|
+
puts "usage:"
|
12
|
+
puts "\t(sh)>gocdss 'http://localhost:5832' 'https://hooks.slack.com/services/abo3ot' my_bot_name"
|
13
|
+
puts "\t(sh)>gocdss 'http://localhost:5832' 'https://hooks.slack.com/services/abo3ot' my_bot_name user:pass"
|
14
|
+
puts "-------------------------------------------------------------------------------------------"
|
15
|
+
exit 1
|
16
|
+
end
|
17
|
+
usage unless gocd_addr and slack_hook and bot_name
|
18
|
+
|
19
|
+
server = Gocdss::Server.new gocd_addr: gocd_addr, slack_hook: slack_hook, bot_name: bot_name, user_pass:user_pass
|
20
|
+
server.start
|
21
|
+
|
22
|
+
#require 'json'
|
23
|
+
#events = JSON.parse(File.read "./spec/assets/cancelled_first")
|
24
|
+
|
25
|
+
#loop do
|
26
|
+
#server.process_event events.shift
|
27
|
+
#break if events.empty?
|
28
|
+
#end
|
data/boojs
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'boojs/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "boojs"
|
8
|
+
spec.version = BooJS::VERSION
|
9
|
+
spec.authors = ["Seo Townsend"]
|
10
|
+
spec.email = ["seotownsend@icloud.com"]
|
11
|
+
spec.summary = %q{Execute browser compatible javascript in a unix friendly tool}
|
12
|
+
spec.description = %q{PhantomJS is not a friendly unix tool, this tool respects stdout, stdin, and stderr}
|
13
|
+
spec.homepage = "https://github.com/sotownsend/boojs"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.3"
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.2"
|
24
|
+
spec.add_runtime_dependency "activesupport", "~> 4.2"
|
25
|
+
end
|
data/boojs.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'boojs/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "boojs"
|
8
|
+
spec.version = BooJS::VERSION
|
9
|
+
spec.authors = ["seo"]
|
10
|
+
spec.email = ["seotownsend@icloud.com"]
|
11
|
+
spec.summary = "A boring javascript application framework"
|
12
|
+
spec.description = "A unix tool to execute javascript on a headless browser"
|
13
|
+
spec.homepage = "https://github.com/sotownsend/BooJS"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_runtime_dependency "phantomjs", "~> 1.9"
|
22
|
+
spec.executables << 'boojs'
|
23
|
+
end
|
24
|
+
|
data/lib/boo.js
ADDED
data/logo.png
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: boojs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- seo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: phantomjs
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
description: A unix tool to execute javascript on a headless browser
|
28
|
+
email:
|
29
|
+
- seotownsend@icloud.com
|
30
|
+
executables:
|
31
|
+
- boojs
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- ".gitignore"
|
36
|
+
- ".travis.yml"
|
37
|
+
- Gemfile
|
38
|
+
- LICENSE
|
39
|
+
- README.md
|
40
|
+
- Rakefile
|
41
|
+
- bin/boojs
|
42
|
+
- boojs
|
43
|
+
- boojs.gemspec
|
44
|
+
- lib/boo.js
|
45
|
+
- lib/boojs/version.rb
|
46
|
+
- logo.png
|
47
|
+
homepage: https://github.com/sotownsend/BooJS
|
48
|
+
licenses:
|
49
|
+
- MIT
|
50
|
+
metadata: {}
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 2.4.6
|
68
|
+
signing_key:
|
69
|
+
specification_version: 4
|
70
|
+
summary: A boring javascript application framework
|
71
|
+
test_files: []
|