atomic-parsley-ruby 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0e1083dc8532082d4e1eaa179ffec5348133b40f
4
+ data.tar.gz: 7d06bd31a02293f9d089c44fddd837e49d26c154
5
+ SHA512:
6
+ metadata.gz: 1e313e42e5e9b411a291a6d9ed50b71a00048f5087512b84318af0e5b2bba12312c60a72c5d60e87713ebfe6d562b8eaee84ff22b646271043503dca6a77bc91
7
+ data.tar.gz: bedbe8c2417aa1d0ebde5cc2773b6788c52cdd072919a7ee835999c19c7215f8a742f7fc3d6afad4ccfa5cc1c9d3c5cf5810d814c4a86d2da0795af542c6df61
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .idea/
7
+ .idea/*
8
+ Gemfile.lock
9
+ InstalledFiles
10
+ _yardoc
11
+ coverage
12
+ doc/
13
+ lib/bundler/man
14
+ pkg
15
+ rdoc
16
+ spec/reports
17
+ test/tmp
18
+ test/version_tmp
19
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in atomic-parsley-ruby-parsley-ruby.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 cparratto
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # AtomicParsleyRuby
2
+
3
+ A wrapper api for the atomic-parsley cli...
4
+
5
+ ## Installation
6
+
7
+ OSX
8
+ brew install AtomicParsley
9
+ Ubuntu
10
+ sudo apt-get install AtomicParsley
11
+ Windows
12
+ install Linux
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ gem 'atomic-parsley-ruby'
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install atomic-parsley-ruby
25
+
26
+ ## Usage
27
+
28
+ v = AtomicParsleyRuby::Media.new("test.mp4")
29
+
30
+ v.encode do |config|
31
+ config.artist "Some Guy"
32
+ config.year "2012"
33
+ config.genre "Punk Rock"
34
+ config.artwork "cover.png"
35
+ end
36
+
37
+ ## Contributing
38
+
39
+ 1. Fork it
40
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
41
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
42
+ 4. Push to the branch (`git push origin my-new-feature`)
43
+ 5. Create new Pull Request
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core'
3
+ require 'rspec/core/rake_task'
4
+ desc "Run all spec in spec directory (excluding plugin spec)"
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task :default => :spec
@@ -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 'atomic-parsley-ruby/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "atomic-parsley-ruby"
8
+ spec.version = AtomicParsleyRuby::VERSION
9
+ spec.authors = ["cparratto"]
10
+ spec.email = ["cparratto@pnmac.com"]
11
+ spec.description = %q{A wrapper api for the atomic-parsley cli}
12
+ spec.summary = %q{I take no major credit for this its simply just a wrapper for the c application available at http://atomicparsley.sourceforge.net/}
13
+ spec.homepage = "https://github.com/cparratto/atomic-parsley-ruby"
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 "rspec"
24
+ spec.add_development_dependency "mocha"
25
+ end
@@ -0,0 +1,6 @@
1
+ require 'shellwords'
2
+ require "atomic-parsley-ruby/version"
3
+ require "atomic-parsley-ruby/exception"
4
+ require "atomic-parsley-ruby/dependency"
5
+ require "atomic-parsley-ruby/file"
6
+ require "atomic-parsley-ruby/media"
@@ -0,0 +1,24 @@
1
+ module AtomicParsleyRuby
2
+ module Dependency
3
+ def self.path
4
+ p = Dependency.which('AtomicParsley')
5
+ if p.nil?
6
+ raise ::AtomicParsleyRuby::Exception, "AtomicParsley is not in your path."
7
+ end
8
+ p
9
+ end
10
+
11
+ private
12
+
13
+ def self.which(cmd)
14
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
15
+ ENV['PATH'].split(::File::PATH_SEPARATOR).each do |path|
16
+ exts.each { |ext|
17
+ exe = ::File.join(path, "#{cmd}#{ext}")
18
+ return exe if ::File.executable? exe
19
+ }
20
+ end
21
+ return nil
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+ module AtomicParsleyRuby
2
+ class Exception < StandardError
3
+ def initialize(msg = "AtomicParsleyException: Generic Exception Msg.")
4
+ super(msg)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ module AtomicParsleyRuby
2
+ module File
3
+ def self.valid?(fn)
4
+ if ![".m4v", ".mp4", ".mp3"].include?(::File.extname(fn))
5
+ raise ::AtomicParsleyRuby::Exception, "Invalid file type."
6
+ end
7
+ true
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module AtomicParsleyRuby
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,15 @@
1
+ require "spec_helper"
2
+
3
+ module AtomicParsleyRuby
4
+ describe Dependency do
5
+ it "raises an exception when AtomicParsley in not in your path" do
6
+ Dependency.stubs("which").with("AtomicParsley").returns("/usr/bin/AtomicParsley")
7
+ Dependency.path.should eq "/usr/bin/AtomicParsley"
8
+ end
9
+
10
+ it "returns the path when AtomicParsley is in your path" do
11
+ Dependency.stubs("which").with("AtomicParsley").returns(nil)
12
+ expect {Dependency.path}.to raise_error(::AtomicParsleyRuby::Exception, "AtomicParsley is not in your path.")
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,21 @@
1
+ require "spec_helper"
2
+
3
+ module AtomicParsleyRuby
4
+ describe File do
5
+ it "raises an error when an incorrect file name is passed" do
6
+ expect {::AtomicParsleyRuby::File.valid?("test.txt")}.to raise_error(::AtomicParsleyRuby::Exception,"Invalid file type.")
7
+ end
8
+
9
+ it "does not raise an error for mp4s" do
10
+ ::AtomicParsleyRuby::File.valid?("test.mp4").should be_true
11
+ end
12
+
13
+ its "does not raise an error for m4vs" do
14
+ ::AtomicParsleyRuby::File.valid?("test.m4v").should be_true
15
+ end
16
+
17
+ its "does not raise an error for mp3s" do
18
+ ::AtomicParsleyRuby::File.valid?("test.mp3").should be_true
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,8 @@
1
+ require 'rspec'
2
+
3
+ require 'atomic-parsley-ruby' # and any other gems you need
4
+
5
+ RSpec.configure do |config|
6
+ config.mock_with :mocha
7
+ config.order = "random"
8
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: atomic-parsley-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - cparratto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-05 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: rspec
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: mocha
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
+ description: A wrapper api for the atomic-parsley cli
70
+ email:
71
+ - cparratto@pnmac.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - atomic-parsley-ruby.gemspec
82
+ - lib/atomic-parsley-ruby.rb
83
+ - lib/atomic-parsley-ruby/dependency.rb
84
+ - lib/atomic-parsley-ruby/exception.rb
85
+ - lib/atomic-parsley-ruby/file.rb
86
+ - lib/atomic-parsley-ruby/version.rb
87
+ - spec/dependency_spec.rb
88
+ - spec/file_spec.rb
89
+ - spec/spec_helper.rb
90
+ homepage: https://github.com/cparratto/atomic-parsley-ruby
91
+ licenses:
92
+ - MIT
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 2.0.3
111
+ signing_key:
112
+ specification_version: 4
113
+ summary: I take no major credit for this its simply just a wrapper for the c application
114
+ available at http://atomicparsley.sourceforge.net/
115
+ test_files:
116
+ - spec/dependency_spec.rb
117
+ - spec/file_spec.rb
118
+ - spec/spec_helper.rb