dsh 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 229d542c79cc7c2e6b25c4a1dd9200c3ba0fdb3b
4
+ data.tar.gz: 0304e59806df4f7ba0bdc09f8ac633b7f02a59d2
5
+ SHA512:
6
+ metadata.gz: db2f08e6fd24bd1696a458cf3ebdc225ba25147741862c8b7eb5fbb09b4ffbec34fc7f4981671d63c8f2cc8b8203c362d56f94a2f360852014f7d38adf77acff
7
+ data.tar.gz: 61ec995f5118960033248934a2b95d667b8be92a073a2c431fba9c02023f19e4553391ec068b4194fc20cdb16a380df0c7a31971fabce407c88ba6b363eec1bb
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dsh.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,46 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dsh (0.1.0)
5
+ methadone (~> 1.3.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ aruba (0.5.3)
11
+ childprocess (>= 0.3.6)
12
+ cucumber (>= 1.1.1)
13
+ rspec-expectations (>= 2.7.0)
14
+ builder (3.2.2)
15
+ childprocess (0.3.9)
16
+ ffi (~> 1.0, >= 1.0.11)
17
+ cucumber (1.3.8)
18
+ builder (>= 2.1.2)
19
+ diff-lcs (>= 1.1.3)
20
+ gherkin (~> 2.12.1)
21
+ multi_json (>= 1.7.5, < 2.0)
22
+ multi_test (>= 0.0.2)
23
+ diff-lcs (1.2.4)
24
+ ffi (1.9.3)
25
+ gherkin (2.12.2)
26
+ multi_json (~> 1.3)
27
+ json (1.8.1)
28
+ methadone (1.3.1)
29
+ bundler
30
+ multi_json (1.8.2)
31
+ multi_test (0.0.2)
32
+ rake (0.9.6)
33
+ rdoc (4.0.1)
34
+ json (~> 1.4)
35
+ rspec-expectations (2.14.3)
36
+ diff-lcs (>= 1.1.3, < 2.0)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ aruba
43
+ bundler (~> 1.3)
44
+ dsh!
45
+ rake (~> 0.9.2)
46
+ rdoc
data/LICENSE.txt ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2013 Christopher Simpkins
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Dsh
2
+
3
+ A command line search interface to programming language documentation in the Dash application (Mac OSX) with optional docset keyword filters.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'dsh'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install dsh
18
+
19
+ ## Usage
20
+
21
+ To search across all language docsets, simply enter your search query after the `dsh` command:
22
+
23
+ dsh <search_term(s)>
24
+
25
+ To restrict your search to a specific programming language docset, use the `-l` or `--lang` flags with the docset keyword as the argument:
26
+
27
+ dsh -l ruby puts
28
+
29
+
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = dsh - A command line search interface to programming language documentation in the Mac OSX Dash application.
2
+
3
+ Author:: Christopher Simpkins
4
+ Copyright:: Copyright (c) 2013 Christopher Simpkins
5
+
6
+
7
+ License:: mit, see LICENSE.txt
8
+
9
+ == Links
10
+
11
+ * {Source on Github}[https://github.com/chrissimpkins/dsh]
12
+ * RDoc[LINK TO RDOC.INFO]
13
+
14
+ == Install
15
+
16
+ == Examples
17
+
18
+ == Contributing
19
+
data/Rakefile ADDED
@@ -0,0 +1,61 @@
1
+ def dump_load_path
2
+ puts $LOAD_PATH.join("\n")
3
+ found = nil
4
+ $LOAD_PATH.each do |path|
5
+ if File.exists?(File.join(path,"rspec"))
6
+ puts "Found rspec in #{path}"
7
+ if File.exists?(File.join(path,"rspec","core"))
8
+ puts "Found core"
9
+ if File.exists?(File.join(path,"rspec","core","rake_task"))
10
+ puts "Found rake_task"
11
+ found = path
12
+ else
13
+ puts "!! no rake_task"
14
+ end
15
+ else
16
+ puts "!!! no core"
17
+ end
18
+ end
19
+ end
20
+ if found.nil?
21
+ puts "Didn't find rspec/core/rake_task anywhere"
22
+ else
23
+ puts "Found in #{path}"
24
+ end
25
+ end
26
+ require 'bundler'
27
+ require 'rake/clean'
28
+
29
+ require 'rake/testtask'
30
+
31
+ require 'cucumber'
32
+ require 'cucumber/rake/task'
33
+ gem 'rdoc' # we need the installed RDoc gem, not the system one
34
+ require 'rdoc/task'
35
+
36
+ include Rake::DSL
37
+
38
+ Bundler::GemHelper.install_tasks
39
+
40
+
41
+ Rake::TestTask.new do |t|
42
+ t.pattern = 'test/tc_*.rb'
43
+ end
44
+
45
+
46
+ CUKE_RESULTS = 'results.html'
47
+ CLEAN << CUKE_RESULTS
48
+ Cucumber::Rake::Task.new(:features) do |t|
49
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x"
50
+ t.fork = false
51
+ end
52
+
53
+ Rake::RDocTask.new do |rd|
54
+
55
+ rd.main = "README.rdoc"
56
+
57
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
58
+ end
59
+
60
+ task :default => [:test,:features]
61
+
data/bin/dsh ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'methadone'
5
+ require 'open3'
6
+ require 'dsh.rb'
7
+
8
+ class App
9
+ include Methadone::Main
10
+ #include Methadone::CLILogging
11
+
12
+ main do |query|
13
+ language = options["l"]
14
+ search_command = Dsh.makeCommand(query, language)
15
+ stdout_str, stderr_str, status = Open3.capture3(search_command)
16
+ unless status.exitstatus == 0
17
+ STDERR.puts "Unable to launch Dash."
18
+ STDERR.puts stderr_str
19
+ exit 1
20
+ end
21
+ end
22
+
23
+ description "A command line interface to search programming language documentation in the Dash application (Mac OSX) with optional docset keyword filters."
24
+ # Docset Language Flag:
25
+ on("-l <language>","Language docset filter")
26
+ # Required argument
27
+ arg :query, :required
28
+
29
+ version Dsh::VERSION
30
+
31
+ #use_log_level_option
32
+
33
+ go!
34
+ end
data/dsh.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'dsh/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "dsh"
8
+ spec.version = Dsh::VERSION
9
+ spec.authors = ["Chris Simpkins"]
10
+ spec.email = ["git.simpkins@gmail.com"]
11
+ spec.description = %q{A command line interface to search programming language documentation in the Dash application (Mac OSX) with optional docset keyword filters.}
12
+ spec.summary = %q{dsh}
13
+ spec.homepage = "http://rubygems.org/gems/dsh"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
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.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency('rdoc')
24
+ spec.add_development_dependency('aruba')
25
+ spec.add_development_dependency('rake', '~> 0.9.2')
26
+ spec.add_dependency('methadone', '~> 1.3.1')
27
+ end
@@ -0,0 +1,13 @@
1
+ Feature: My bootstrapped app kinda works
2
+ In order to get going on coding my awesome app
3
+ I want to have aruba and cucumber setup
4
+ So I don't have to do it myself
5
+
6
+ Scenario: App just runs
7
+ When I get help for "dsh"
8
+ Then the exit status should be 0
9
+ And the banner should be present
10
+ And the banner should document that this app takes options
11
+ And the following options should be documented:
12
+ |--version|
13
+ And the banner should document that this app takes no arguments
@@ -0,0 +1 @@
1
+ # Put your step definitions here
@@ -0,0 +1,16 @@
1
+ require 'aruba/cucumber'
2
+ require 'methadone/cucumber'
3
+
4
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
5
+ LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
6
+
7
+ Before do
8
+ # Using "announce" causes massive warnings on 1.9.2
9
+ @puts = true
10
+ @original_rubylib = ENV['RUBYLIB']
11
+ ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
12
+ end
13
+
14
+ After do
15
+ ENV['RUBYLIB'] = @original_rubylib
16
+ end
@@ -0,0 +1,3 @@
1
+ module Dsh
2
+ VERSION = "0.1.0"
3
+ end
data/lib/dsh.rb ADDED
@@ -0,0 +1,12 @@
1
+ require "dsh/version"
2
+
3
+ module Dsh
4
+ # supplemental methods here
5
+ def Dsh.makeCommand(query, language)
6
+ if language.to_s == ''
7
+ command = "open dash://" + query
8
+ else
9
+ command = "open dash://" + language + ":" + query
10
+ end
11
+ end #end makeCommand()
12
+ end #end Dsh module
@@ -0,0 +1,7 @@
1
+ require 'test/unit'
2
+
3
+ class TestSomething < Test::Unit::TestCase
4
+ def test_truth
5
+ assert true
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,148 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dsh
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Chris Simpkins
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rdoc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
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: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 0.9.2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.9.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: methadone
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 1.3.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 1.3.1
97
+ description: A command line interface to search programming language documentation
98
+ in the Dash application (Mac OSX) with optional docset keyword filters.
99
+ email:
100
+ - git.simpkins@gmail.com
101
+ executables:
102
+ - dsh
103
+ extensions: []
104
+ extra_rdoc_files: []
105
+ files:
106
+ - Gemfile
107
+ - Gemfile.lock
108
+ - LICENSE.txt
109
+ - README.md
110
+ - README.rdoc
111
+ - Rakefile
112
+ - bin/dsh
113
+ - dsh.gemspec
114
+ - features/dsh.feature
115
+ - features/step_definitions/dsh_steps.rb
116
+ - features/support/env.rb
117
+ - lib/dsh.rb
118
+ - lib/dsh/version.rb
119
+ - test/tc_something.rb
120
+ homepage: http://rubygems.org/gems/dsh
121
+ licenses:
122
+ - MIT
123
+ metadata: {}
124
+ post_install_message:
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubyforge_project:
140
+ rubygems_version: 2.1.10
141
+ signing_key:
142
+ specification_version: 4
143
+ summary: dsh
144
+ test_files:
145
+ - features/dsh.feature
146
+ - features/step_definitions/dsh_steps.rb
147
+ - features/support/env.rb
148
+ - test/tc_something.rb