djnml 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +19 -0
- data/LICENSE.txt +24 -0
- data/README.rdoc +35 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/djnml.gemspec +79 -0
- data/lib/djnml/codes.rb +3127 -0
- data/lib/djnml/delete.rb +13 -0
- data/lib/djnml/modification.rb +244 -0
- data/lib/djnml.rb +417 -0
- data/spec/data/20120716155056208LL000587.NML +28 -0
- data/spec/data/20120716161436878LL001634.NML +117 -0
- data/spec/data/20120716162053366LL005062.NML +115 -0
- data/spec/data/20120720222918942LL007284.NML +26 -0
- data/spec/data/DN20080506000741.nml +72 -0
- data/spec/data/DN20080506000785.nml +212 -0
- data/spec/data/DN20080506000839.nml +57 -0
- data/spec/djnml_codes_spec.rb +47 -0
- data/spec/djnml_spec.rb +477 -0
- data/spec/spec_helper.rb +12 -0
- metadata +157 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
|
4
|
+
gem 'nokogiri'
|
5
|
+
gem 'language_detector', :git => 'http://github.com/feedbackmine/language_detector.git'
|
6
|
+
|
7
|
+
# Add dependencies required to use your gem here.
|
8
|
+
# Example:
|
9
|
+
# gem "activesupport", ">= 2.3.5"
|
10
|
+
|
11
|
+
# Add dependencies to develop your gem here.
|
12
|
+
# Include everything needed to run rake, tests, features, etc.
|
13
|
+
group :development do
|
14
|
+
gem "rspec", "~> 2.8.0"
|
15
|
+
gem "rdoc", "~> 3.12"
|
16
|
+
gem "bundler", "> 1.0.0"
|
17
|
+
gem "jeweler", "~> 1.8.4"
|
18
|
+
gem "simplecov", ">= 0"
|
19
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
Copyright (c) 2012, Tobias Begalke
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
6
|
+
* Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
* Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
* Neither the name of the <organization> nor the
|
12
|
+
names of its contributors may be used to endorse or promote products
|
13
|
+
derived from this software without specific prior written permission.
|
14
|
+
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
16
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
17
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
19
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
= djnml
|
2
|
+
|
3
|
+
DJNML is a ruby library that parses Dow Jones NML newsfeed files into an object
|
4
|
+
|
5
|
+
== Synopsis
|
6
|
+
|
7
|
+
require 'djnml'
|
8
|
+
|
9
|
+
nml = DJNML.load('20120716162053366LL005062.NML')
|
10
|
+
lang = nml.language
|
11
|
+
website = nml.website
|
12
|
+
company = nml.company_name
|
13
|
+
text = nml.text
|
14
|
+
html = nml.html
|
15
|
+
market_codes = nml.market_codes
|
16
|
+
market_names = market_codes.map { |c| c.name }
|
17
|
+
|
18
|
+
|
19
|
+
For a complete list of methods please refer to the spec tests.
|
20
|
+
|
21
|
+
== Contributing to djnml
|
22
|
+
|
23
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
24
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
25
|
+
* Fork the project.
|
26
|
+
* Start a feature/bugfix branch.
|
27
|
+
* Commit and push until you are happy with your contribution.
|
28
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
29
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
30
|
+
|
31
|
+
== Copyright
|
32
|
+
|
33
|
+
Copyright (c) 2012 Tobias Begalke. See LICENSE.txt for
|
34
|
+
further details.
|
35
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "djnml"
|
18
|
+
gem.homepage = "http://github.com/elcamino/djnml"
|
19
|
+
gem.license = "BSD"
|
20
|
+
gem.summary = %Q{A ruby library to parse Dow Jones NML newsfeed files}
|
21
|
+
gem.description = %Q{This ruby library parses Dow Jones NML files into a DJNML object}
|
22
|
+
gem.email = "elcamino@spyz.org"
|
23
|
+
gem.authors = ["Tobias Begalke"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rdoc/task'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "djnml #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.2
|
data/djnml.gemspec
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{djnml}
|
8
|
+
s.version = "1.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Tobias Begalke"]
|
12
|
+
s.date = %q{2012-07-30}
|
13
|
+
s.description = %q{This ruby library parses Dow Jones NML files into a DJNML object}
|
14
|
+
s.email = %q{elcamino@spyz.org}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"djnml.gemspec",
|
28
|
+
"lib/djnml.rb",
|
29
|
+
"lib/djnml/codes.rb",
|
30
|
+
"lib/djnml/delete.rb",
|
31
|
+
"lib/djnml/modification.rb",
|
32
|
+
"spec/data/20120716155056208LL000587.NML",
|
33
|
+
"spec/data/20120716161436878LL001634.NML",
|
34
|
+
"spec/data/20120716162053366LL005062.NML",
|
35
|
+
"spec/data/20120720222918942LL007284.NML",
|
36
|
+
"spec/data/DN20080506000741.nml",
|
37
|
+
"spec/data/DN20080506000785.nml",
|
38
|
+
"spec/data/DN20080506000839.nml",
|
39
|
+
"spec/djnml_codes_spec.rb",
|
40
|
+
"spec/djnml_spec.rb",
|
41
|
+
"spec/spec_helper.rb"
|
42
|
+
]
|
43
|
+
s.homepage = %q{http://github.com/elcamino/djnml}
|
44
|
+
s.licenses = ["BSD"]
|
45
|
+
s.require_paths = ["lib"]
|
46
|
+
s.rubygems_version = %q{1.6.2}
|
47
|
+
s.summary = %q{A ruby library to parse Dow Jones NML newsfeed files}
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
s.specification_version = 3
|
51
|
+
|
52
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
53
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
54
|
+
s.add_runtime_dependency(%q<language_detector>, [">= 0"])
|
55
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
56
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
57
|
+
s.add_development_dependency(%q<bundler>, ["> 1.0.0"])
|
58
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
59
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
62
|
+
s.add_dependency(%q<language_detector>, [">= 0"])
|
63
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
64
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
65
|
+
s.add_dependency(%q<bundler>, ["> 1.0.0"])
|
66
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
67
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
68
|
+
end
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
71
|
+
s.add_dependency(%q<language_detector>, [">= 0"])
|
72
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
73
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
74
|
+
s.add_dependency(%q<bundler>, ["> 1.0.0"])
|
75
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
76
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|