Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Slithtly updated project setup and documentation. Made tests run on 1…

….9.3.
  • Loading branch information...
commit 28461cacde2af5f2464f4fbe93e64556d1f76261 1 parent 8af66ac
@aef authored
View
29 .autotest
@@ -1,29 +0,0 @@
-# -*- ruby -*-
-
-module Autotest::GnomeNotify
-
- # Time notification will be displayed before disappearing automatically
- EXPIRATION_IN_SECONDS = 2
- ERROR_STOCK_ICON = "gtk-dialog-error"
- SUCCESS_STOCK_ICON = "gtk-dialog-info"
-
- # Convenience method to send an error notification message
- #
- # [stock_icon] Stock icon name of icon to display
- # [title] Notification message title
- # [message] Core message for the notification
- def self.notify stock_icon, title, message
- options = "-t #{EXPIRATION_IN_SECONDS * 1000} -i #{stock_icon}"
- system "notify-send #{options} '#{title}' '#{message}'"
- end
-
- Autotest.add_hook :red do |at|
- notify ERROR_STOCK_ICON, "Tests failed", "#{at.files_to_test.size} tests failed"
- end
-
- Autotest.add_hook :green do |at|
- notify SUCCESS_STOCK_ICON, "All tests passed, good job!", ""
- end
-
-end
-
View
1  .rspec
@@ -0,0 +1 @@
+--color
View
8 .travis.yml
@@ -0,0 +1,8 @@
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - 1.9.3
+ - rbx-18mode
+ - rbx-19mode
+ - jruby-18mode
+ - jruby-19mode
View
5 .yardopts
@@ -0,0 +1,5 @@
+--protected
+--no-private
+-
+HISTORY.md
+LICENSE.md
View
23 Gemfile
@@ -0,0 +1,23 @@
+# encoding: UTF-8
+=begin
+Copyright Alexander E. Fischer <aef@raxys.net>, 2009-2012
+
+This file is part of Linebreak.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+=end
+
+source 'http://rubygems.org'
+
+# Specify your gem's dependencies in weekling.gemspec
+gemspec
View
32 History.txt → History.md
@@ -1,4 +1,16 @@
-=== 1.3.1 / 2009-09-14
+2.0.0 / 2012-??-??
+==================
+
+* 1 major enhancement
+
+ * Changed to ISC based license
+
+* 1 minor enhancement
+
+ * Slightly restructured project
+
+1.3.1 / 2009-09-14
+==================
* 1 major bugfix
@@ -8,7 +20,8 @@
* Implemented autoloading
-=== 1.3.0 / 2009-08-11
+1.3.0 / 2009-08-11
+==================
* 3 major enhancements
@@ -23,7 +36,8 @@
* Used the Pathname class where possible
* Upgraded to use the latest hoe gem
-=== 1.2.0 / 2009-04-05
+1.2.0 / 2009-04-05
+==================
* 2 major enhancements
@@ -42,7 +56,8 @@
* Fixed some bugs related to Ruby 1.8.6
-=== 1.1.1 / 2009-03-08
+1.1.1 / 2009-03-08
+==================
* minor enhancement
@@ -50,7 +65,8 @@
* Some test refactoring
* Some more comments
-=== 1.1.0 / 2009-03-01
+1.1.0 / 2009-03-01
+==================
* 2 major enhancements
@@ -61,7 +77,8 @@
* Added support for custom string linebreak encodings in library
-=== 1.0.1 / 2009-02-24
+1.0.1 / 2009-02-24
+==================
* 1 minor enhancement
@@ -71,7 +88,8 @@
* Bugfixes for commandline use
-=== 1.0.0 / 2009-02-24
+1.0.0 / 2009-02-24
+==================
* 1 major enhancement
View
23 Manifest.txt
@@ -1,23 +0,0 @@
-History.txt
-Manifest.txt
-README.rdoc
-COPYING.txt
-Rakefile
-bin/linebreak
-lib/aef/linebreak.rb
-lib/aef/linebreak/string_extension.rb
-lib/aef/linebreak/commands/encode.rb
-lib/aef/linebreak/commands/encodings.rb
-lib/aef/linebreak/commands/version.rb
-lib/aef/linebreak/pathname_conversion.rb
-lib/aef/linebreak/linebreak.rb
-spec/spec_helper.rb
-spec/linebreak_spec.rb
-spec/spec.opts
-spec/fixtures/unix.txt
-spec/fixtures/windows.txt
-spec/fixtures/mac.txt
-spec/fixtures/unix_windows.txt
-spec/fixtures/windows_mac.txt
-spec/fixtures/mac_unix.txt
-spec/fixtures/unix_windows_mac.txt
View
240 README.md
@@ -0,0 +1,240 @@
+Linebreak
+=========
+
+[![Build Status](https://secure.travis-ci.org/aef/linebreak.png)](
+https://secure.travis-ci.org/aef/linebreak)
+
+* [Documentation][1]
+* [Project][2]
+
+ [1]: http://rdoc.info/projects/aef/linebreak/
+ [2]: http://github.com/aef/linebreak/
+
+Description
+-----------
+
+Linebreak is a Ruby library and commandline tool for conversion of text
+between linebreak encoding formats of unix, windows or mac.
+
+Earlier versions of Linebreak were called BreakVerter.
+
+Features / Problems
+-------------------
+
+This projects tries to conform to:
+
+* [Semantic Versioning (2.0.0-rc.1)][5]
+* [Ruby Packaging Standard (0.5-draft)][6]
+* [Ruby Style Guide][7]
+* [Gem Packaging: Best Practices][8]
+
+ [5]: http://semver.org/
+ [6]: http://chneukirchen.github.com/rps/
+ [7]: https://github.com/bbatsov/ruby-style-guide
+ [8]: http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices
+
+Additional facts:
+
+* Written purely in Ruby.
+* Intended to be used with Ruby 1.8.7 or higher.
+
+Synopsis
+--------
+
+This documentation defines the public interface of the library. Don't rely
+on elements marked as private. Those should be hidden in the documentation
+by default.
+
+### Loading
+
+In most cases you want to load the library by the following command:
+
+~~~~~ ruby
+require 'linebreak'
+~~~~~
+
+In a bundler Gemfile you should use the following:
+
+~~~~~ ruby
+gem 'linebreak'
+~~~~~
+
+### Library
+
+You can put strings or objects responding to to_s into the method and
+optionally define a target linebreak encoding. The default encoding is :unix.
+You can also choose :mac and :windows. Notice that the :mac encoding is
+deprecated. Modern Apple machines also use :unix linebreak encoding, while
+Commodore machines also use the :mac linebreak encoding.
+
+~~~~~ ruby
+windows_string = "Abcdef\r\nAbcdef\r\nAbcdef"
+
+Aef::Linebreak.encode(windows_string, :unix)
+#=> "Abcdef\nAbcdef\nAbcdef"
+~~~~~
+
+You can detect which decoding systems are used in a string:
+
+~~~~~ ruby
+mixed_unix_and_mac_string = "Abcdef\rAbcdef\nAbcdef"
+
+Aef::Linebreak.encodings(mixed_unix_and_mac_string)
+#=> #<Set: {:unix, :mac}>
+~~~~~
+
+You can also easily ensure that a string contains exactly the linebreak
+encodings you expect it to contain:
+
+~~~~~ ruby
+mixed_windows_and_mac_string = "Abcdef\r\nAbcdef\rAbcdef"
+
+Aef::Linebreak.encoding?(mixed_windows_and_mac_string, :windows)
+#=> false
+
+Aef::Linebreak.encoding?(mixed_windows_and_mac_string, :windows, :mac)
+#=> true
+~~~~~
+
+Note that the expected linebreak systems could also be given as an array or a
+set.
+
+Alternatively you could include Linebreak into the String class and use it in
+the following way:
+
+~~~~~ ruby
+require 'aef/linebreak/string_extension'
+
+"Abcdef\nAbcdef\nAbcdef".linebreak_encode(:mac)
+#=> "Abcdef\rAbcdef\rAbcdef"
+
+"Abcdef\r\nAbcdef\nAbcdef".linebreak_encodings
+#=> #<Set: {:unix, :windows}>
+
+"Abcdef\nAbcdef\nAbcdef".linebreak_encoding?(:unix, :windows)
+#=> false
+
+"Abcdef\nAbcdef\nAbcdef".linebreak_encoding?(:unix)
+#=> true
+~~~~~
+
+### Command-line tool
+
+The default output encoding is unix. You can also choose mac and windows.
+
+ linebreak encode --system windows unix.txt windows.txt
+
+If no target file is specified the output will be sent to STDOUT.
+
+ linebreak encode --system windows mac.txt > windows.txt
+
+You can set the default with the environment variable LINEBREAK_SYSTEM.
+
+ export LINEBREAK_SYSTEM=mac
+
+ linebreak encode windows.txt mac.txt
+
+If you do not specify an output file, output will be put to STDOUT. If you also
+do not specify an input file, input will be expected from STDIN.
+
+You can also detect the linebreak systems contained in a file in the following
+way:
+
+ linebreak encodings windows_mac.txt
+
+If you want to ensure that a file contains the exact encodings systems you
+specified, you can use the following command:
+
+ linebreak encodings --ensure unix,windows,mac unix.txt
+
+The results will be outputted. In case of a file containing other linebreak
+encoding systems there will be an exit code of 1.
+
+It is also possible to specify multiple input files or none to expect input from
+STDIN.
+
+Requirements
+------------
+
+* Ruby 1.8.7 or higher
+* user-choices for command line tool
+
+Installation
+------------
+
+On *nix systems you may need to prefix the command with sudo to get root
+privileges.
+
+### High security (recommended)
+
+There is a high security installation option available through rubygems. It is
+highly recommended over the normal installation, although it may be a bit less
+comfortable. To use the installation method, you will need my public key, which
+I use for cryptographic signatures on all my gems. You can find the public key
+here: http://aef.name/crypto/aef-gem.pem
+
+Add the key to your rubygems' trusted certificates by the following command:
+
+ gem cert --add aef-gem.pem
+
+Now you can install the gem while automatically verifying it's signature by the
+following command:
+
+ gem install linebreak -P HighSecurity
+
+Please notice that you may need other keys for dependent libraries, so you may
+have to install dependencies manually.
+
+### Normal
+
+ gem install linebreak
+
+### Automated testing
+
+Go into the root directory of the installed gem and run the following command
+to fetch all development dependencies:
+
+ bundle
+
+Afterwards start the test runner:
+
+ rake spec
+
+If something goes wrong you should be noticed through failing examples.
+
+Development
+-----------
+
+This software is developed in the source code management system git hosted
+at github.com. You can download the most recent sourcecode through the
+following command:
+
+ git clone https://github.com/aef/linebreak.git
+
+Help on making this software better is always very appreciated. If you want
+your changes to be included in the official release, please clone my project
+on github.com, create a named branch to commit and push your changes in and
+send me a pull request afterwards.
+
+Please make sure to write tests for your changes so that I won't break them
+when changing other things on the library. Also notice that I can't promise
+to include your changes before reviewing them.
+
+License
+-------
+
+Copyright Alexander E. Fischer <aef@raxys.net>, 2009-2012
+
+This file is part of Linebreak.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
View
233 README.rdoc
@@ -1,233 +0,0 @@
-= Linebreak
-
-* Project: https://rubyforge.org/projects/linebreak/
-* RDoc: http://rdoc.info/projects/aef/linebreak/
-* RDoc: http://linebreak.rubyforge.org/
-* Github: http://github.com/aef/linebreak/
-
-== DESCRIPTION:
-
-Linebreak is a Ruby library and commandline tool for conversion of text
-between linebreak encoding formats of unix, windows or mac.
-
-== FEATURES/PROBLEMS:
-
-* Completely written in Ruby
-* Core class extensions are optionally loadable
-* Tested and fully working on:
- * Ubuntu Linux 9.04 i386_64
- * Ruby 1.8.7p72
- * Ruby 1.9.1p129
- * JRuby 1.3.1 (22 tests fail, but it's fully usable)
- * Debian GNU/Linux 4.0 i386
- * Ruby 1.8.6
- * Windows XP i386
- * Ruby 1.8.6 (tests fail completely because of problems with popen4)
-* The commandline tool does only work with a patched user-choices gem on Ruby
- 1.9 or higher. See the INSTALL section for further instructions.
-
-== SYNOPSIS:
-
-=== Commandline
-
-The default output encoding is unix. You can also choose mac and windows.
-
- linebreak encode --system windows unix.txt windows.txt
-
-If no target file is specified the output will be sent to STDOUT.
-
- linebreak encode --system windows mac.txt > windows.txt
-
-You can set the default with the environment variable LINEBREAK_SYSTEM.
-
- export LINEBREAK_SYSTEM=mac
-
- linebreak encode windows.txt mac.txt
-
-If you do not specify an output file, output will be put to STDOUT. If you also
-do not specify an input file, input will be expected from STDIN.
-
-You can also detect the linebreak systems contained in a file in the following
-way:
-
- linebreak encodings windows_mac.txt
-
-If you want to ensure that a file contains the exact encodings systems you
-specified, you can use the following command:
-
- linebreak encodings --ensure unix,windows,mac unix.txt
-
-The results will be outputted. In case of a file containing other linebreak
-encoding systems there will be an exit code of 1.
-
-It is also possible to specify multiple input files or none to expect input from
-STDIN.
-
-=== Library
-
-First of all you have to load the Linebreak gem:
-
- require 'aef/linebreak'
-
-You can put strings or objects responding to to_s into the method and
-optionally define a target linebreak encoding. The default encoding is :unix.
-You can also choose :mac and :windows. Notice that the :mac encoding is
-deprecated. Modern Apple machines also use :unix linebreak encoding, while
-Commodore machines also use the :mac linebreak encoding.
-
- windows_string = "Abcdef\r\nAbcdef\r\nAbcdef"
-
- Aef::Linebreak.encode(windows_string, :unix)
- #=> "Abcdef\nAbcdef\nAbcdef"
-
-You can detect which decoding systems are used in a string:
-
- mixed_unix_and_mac_string = "Abcdef\rAbcdef\nAbcdef"
-
- Aef::Linebreak.encodings(mixed_unix_and_mac_string)
- #=> #<Set: {:unix, :mac}>
-
-You can also easily ensure that a string contains exactly the linebreak
-encodings you expect it to contain:
-
- mixed_windows_and_mac_string = "Abcdef\r\nAbcdef\rAbcdef"
-
- Aef::Linebreak.encoding?(mixed_windows_and_mac_string, :windows)
- #=> false
-
- Aef::Linebreak.encoding?(mixed_windows_and_mac_string, :windows, :mac)
- #=> true
-
-Note that the expected linebreak systems could also be given as an array or a
-set.
-
-Alternatively you could include Linebreak into the String class and use it in
-the following way:
-
- require 'aef/linebreak/string_extension'
-
- "Abcdef\nAbcdef\nAbcdef".linebreak_encode(:mac)
- #=> "Abcdef\rAbcdef\rAbcdef"
-
- "Abcdef\r\nAbcdef\nAbcdef".linebreak_encodings
- #=> #<Set: {:unix, :windows}>
-
- "Abcdef\nAbcdef\nAbcdef".linebreak_encoding?(:unix, :windows)
- #=> false
-
- "Abcdef\nAbcdef\nAbcdef".linebreak_encoding?(:unix)
- #=> true
-
-== REQUIREMENTS:
-
-* rubygems
-
-=== Additional for commandline
-* user-choices
-
-=== Additional for automated testing
-* hoe
-* rspec
-* popen4
-
-== INSTALL:
-
-On *nix systems you may need to prefix the command with sudo to get root
-privileges.
-
-If you want to use the commandline tool you need to install the following gem
-manually:
-
- gem install user-choices
-
-On Ruby 1.9 or higher you need to install an inofficially updated version from
-github instead:
-
- gem install qoobaa-user-choices --source http://gems.github.com
-
-You could also patch the normal user-choices gem yourself with a patch written
-by me. You can find it here: https://rubyforge.org/tracker/index.php?func=detail&aid=24307&group_id=4192&atid=16176
-
-=== High security (recommended)
-
-There is a high security installation option available through rubygems. It is
-highly recommended over the normal installation, although it may be a bit less
-comfortable. To use the installation method, you will need my public key, which
-I use for cryptographic signatures on all my gems. You can find the public key
-and more detailed verification information in the aef-certificates section of my
-rubyforge project[https://rubyforge.org/frs/?group_id=7890&release_id=31749]
-
-Add the key to your rubygems' trusted certificates by the following command:
-
- gem cert --add aef.pem
-
-Now you can install the gem while automatically verifying it's signature by the
-following command:
-
- gem install linebreak --ignore-dependencies -P HighSecurity
-
-Please notice that you may need other keys for dependent libraries, so you may
-have to install dependencies manually.
-
-=== Normal (insecure)
-
- gem install linebreak
-
-=== Github (also insecure)
-
-Alternatively you could install linebreak from github which may be a bit more
-up to date. The version may however not be as stable as the normal gem and there
-is no way to install the gem securely. Therefore this is not recommended.
-
- gem install aef-linebreak --source http://gems.github.com
-
-=== Automated testing
-
-You can test this package through rspec on your system. First find the path
-where the gem was installed to:
-
- gem which aef/linebreak
-
-Go into the root directory of the installed gem and run the following command
-to start the test runner:
-
- rake spec
-
-If something goes wrong you should be noticed through failing examples.
-
-== DEVELOPMENT:
-
-This software is developed in the source code management system git hosted
-at github.com. You can download the most recent sourcecode through the following
-command:
-
- git clone git://github.com/aef/linebreak.git
-
-Help on making this software better is always very appreciated. If you want your
-changes to be included in the official release, please send me a patch through
-the project's tracker[https://rubyforge.org/tracker/?group_id=7890] at
-rubyforge.org. You can generate a patch-file by the following command:
-
- git diff > patch.diff
-
-Please make sure to write tests for your changes and notice that I can't promise
-to include your changes before reviewing them.
-
-== LICENSE:
-
-Copyright 2009 Alexander E. Fischer <aef@raxys.net>
-
-This file is part of Linebreak.
-
-Linebreak is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
View
47 Rakefile
@@ -17,26 +17,31 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
=end
-require 'rubygems'
-require 'hoe'
-
-Hoe.spec('linebreak') do
- developer('Alexander E. Fischer', 'aef@raxys.net')
-
- self.rubyforge_name = 'linebreak'
- self.extra_dev_deps = {
- 'user-choices' => '>= 1.1.6',
- 'rspec' => '>= 1.2.8',
- 'popen4' => '>= 0.1.2'
- }
- self.url = 'https://rubyforge.org/projects/linebreak/'
- self.readme_file = 'README.rdoc'
- self.extra_rdoc_files = %w{README.rdoc}
- self.spec_extras = {
- :rdoc_options => ['--main', 'README.rdoc', '--inline-source', '--line-numbers', '--title', 'Linebreak']
- }
- self.rspec_options = ['--options', 'spec/spec.opts']
- self.remote_rdoc_dir = ''
+require 'rake'
+require 'pathname'
+require 'bundler/gem_tasks'
+require 'yard'
+require 'rspec/core/rake_task'
+
+RSpec::Core::RakeTask.new
+
+YARD::Rake::YardocTask.new('doc')
+
+desc "Removes temporary project files"
+task :clean do
+ %w{doc coverage pkg .yardoc .rbx Gemfile.lock}.map{|name| Pathname.new(name) }.each do |path|
+ path.rmtree if path.exist?
+ end
+
+ Pathname.glob('*.gem').each &:delete
+ Pathname.glob('**/*.rbc').each &:delete
+end
+
+desc "Opens an interactive console with the library loaded"
+task :console do
+ require 'pry'
+ require 'linebreak'
+ Pry.start
end
-# vim: syntax=Ruby
+task :default => :spec
View
2  bin/linebreak
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# encoding: UTF-8
=begin
-Copyright Alexander E. Fischer <aef@raxys.net>, 2012
+Copyright Alexander E. Fischer <aef@raxys.net>, 2009-2012
This file is part of Linebreak.
View
26 lib/aef/linebreak/commands/version.rb
@@ -21,20 +21,18 @@
class Aef::Linebreak::VersionCommand
def execute
- name = 'Linebreak'
- puts "#{name} #{Aef::Linebreak::VERSION}"
- puts
- puts 'Project: https://rubyforge.org/projects/linebreak/'
- puts "RDoc: http://#{name.downcase}.rubyforge.org/"
- puts "Github: http://github.com/aef/#{name.downcase}/"
- puts
- puts 'Copyright 2009 Alexander E. Fischer <aef@raxys.net>'
- # Read and print licensing information from the top of this file
- if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('1.8.6')
- puts File.read(__FILE__).map{|line| line[2..-1]}[3..15]
- else
- puts File.read(__FILE__).lines.map{|line| line[2..-1]}[3..15]
- end
+ # Read licensing information from the top of this file
+ license = File.read(__FILE__)[/=begin\n(.*)\n=end/m, 1]
+
+ puts <<-TEXT
+Linebreak #{Aef::Linebreak::VERSION}
+
+Project: https://github.com/aef/linebreak/
+Documentation: http://rubydoc.info/aef/linebreak/
+
+#{license}
+ TEXT
+
exit false
end
end
View
4 lib/aef/linebreak/linebreak.rb
@@ -33,8 +33,6 @@ module Aef::Linebreak
autoload :EncodingsCommand, 'aef/linebreak/commands/encodings'
autoload :VersionCommand, 'aef/linebreak/commands/version'
- VERSION = '1.3.1'
-
BREAK_BY_SYSTEM = {
:unix => "\n",
:windows => "\r\n",
@@ -124,3 +122,5 @@ def linebreak_encode(system_or_replacement = :unix)
Aef::Linebreak.encode(self, system_or_replacement)
end
end
+
+require 'aef/linebreak/version'
View
30 lib/aef/linebreak/version.rb
@@ -0,0 +1,30 @@
+# encoding: UTF-8
+=begin
+Copyright Alexander E. Fischer <aef@raxys.net>, 2009-2012
+
+This file is part of Linebreak.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+=end
+
+module Aef
+ module Linebreak
+
+ # The currently loaded library version
+ #
+ # Using Semantic Versioning (2.0.0-rc.1) rules
+ # @see http://semver.org/
+ VERSION = '2.0.0pre.1'.freeze
+
+ end
+end
View
4 lib/linebreak.rb
@@ -19,6 +19,4 @@
require 'aef/linebreak'
-String.call(:include, Aef::Linebreak)
-
-::Linebreak = Aef::Linebreak unless defined?(::Linebreak)
+String.send(:include, Aef::Linebreak)
View
75 linebreak.gemspec
@@ -17,46 +17,41 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
=end
+require File.expand_path('../lib/aef/linebreak/version', __FILE__)
+
Gem::Specification.new do |s|
- s.name = %q{linebreak}
- s.version = "1.3.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Alexander E. Fischer"]
- s.date = %q{2009-09-16}
- s.default_executable = %q{linebreak}
- s.description = %q{Linebreak is a Ruby library and commandline tool for conversion of text
-between linebreak encoding formats of unix, windows or mac.}
- s.email = ["aef@raxys.net"]
- s.executables = ["linebreak"]
- s.extra_rdoc_files = ["History.txt", "Manifest.txt", "COPYING.txt", "README.rdoc"]
- s.files = ["History.txt", "Manifest.txt", "README.rdoc", "COPYING.txt", "Rakefile", "bin/linebreak", "lib/aef/linebreak.rb", "lib/aef/linebreak/string_extension.rb", "lib/aef/linebreak/commands/encode.rb", "lib/aef/linebreak/commands/encodings.rb", "lib/aef/linebreak/commands/version.rb", "lib/aef/linebreak/pathname_conversion.rb", "lib/aef/linebreak/linebreak.rb", "spec/spec_helper.rb", "spec/linebreak_spec.rb", "spec/spec.opts", "spec/fixtures/unix.txt", "spec/fixtures/windows.txt", "spec/fixtures/mac.txt", "spec/fixtures/unix_windows.txt", "spec/fixtures/windows_mac.txt", "spec/fixtures/mac_unix.txt", "spec/fixtures/unix_windows_mac.txt"]
- s.homepage = %q{https://rubyforge.org/projects/linebreak/}
- s.rdoc_options = ["--main", "README.rdoc", "--inline-source", "--line-numbers", "--title", "Linebreak"]
+ s.name = 'linebreak'
+ s.version = Aef::Linebreak::VERSION.dup
+ s.authors = ['Alexander E. Fischer']
+ s.email = ['aef@raxys.net']
+ s.homepage = 'http://github.com/aef/linebreak'
+ s.license = 'ISC'
+ s.summary = 'Easy linebreak system conversion'
+ s.description = <<-DESCRIPTION
+Linebreak is a Ruby library and commandline tool for conversion of text
+between linebreak encoding formats of unix, windows or mac.
+ DESCRIPTION
+
+ s.rubyforge_project = nil
+ s.has_rdoc = 'yard'
+ s.extra_rdoc_files = ['HISTORY.md', 'LICENSE.md']
+
+ s.files = `git ls-files`.lines.map(&:chomp)
+ s.test_files = `git ls-files -- {test,spec,features}/*`.lines.map(&:chomp)
+ s.executables = `git ls-files -- bin/*`.lines.map{|f| File.basename(f.chomp) }
s.require_paths = ["lib"]
- s.rubyforge_project = %q{linebreak}
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Linebreak is a Ruby library and commandline tool for conversion of text between linebreak encoding formats of unix, windows or mac.}
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 1.2.8"])
- s.add_development_dependency(%q<popen4>, [">= 0.1.2"])
- s.add_development_dependency(%q<user-choices>, [">= 1.1.6"])
- s.add_development_dependency(%q<hoe>, [">= 2.3.2"])
- else
- s.add_dependency(%q<rspec>, [">= 1.2.8"])
- s.add_dependency(%q<popen4>, [">= 0.1.2"])
- s.add_dependency(%q<user-choices>, [">= 1.1.6"])
- s.add_dependency(%q<hoe>, [">= 2.3.2"])
- end
- else
- s.add_dependency(%q<rspec>, [">= 1.2.8"])
- s.add_dependency(%q<popen4>, [">= 0.1.2"])
- s.add_dependency(%q<user-choices>, [">= 1.1.6"])
- s.add_dependency(%q<hoe>, [">= 2.3.2"])
- end
+
+ s.required_ruby_version = '>= 1.8.7'
+
+ s.add_development_dependency('bundler', '~> 1.0.21')
+ s.add_development_dependency('rake', '~> 0.9.2')
+ s.add_development_dependency('rspec', '~> 2.6.0')
+ s.add_development_dependency('simplecov', '~> 0.5.4')
+ s.add_development_dependency('pry', '~> 0.9.8')
+ s.add_development_dependency('yard', '~> 0.7.5')
+ s.add_development_dependency('maruku', '~> 0.6.0')
+ s.add_development_dependency('popen4', '~> 0.1.2')
+
+ s.cert_chain = "#{ENV['GEM_CERT_CHAIN']}".split(':')
+ s.signing_key = ENV['GEM_SIGNING_KEY']
end
View
7 nbproject/project.properties
@@ -1,7 +0,0 @@
-javac.classpath=
-main.file=
-platform.active=Ruby
-source.encoding=UTF-8
-src.bin.dir=bin
-src.lib.dir=lib
-test.spec.dir=spec
View
16 nbproject/project.xml
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.ruby.rubyproject</type>
- <configuration>
- <data xmlns="http://www.netbeans.org/ns/ruby-project/1">
- <name>linebreak</name>
- <source-roots>
- <root id="src.lib.dir"/>
- <root id="src.bin.dir"/>
- </source-roots>
- <test-roots>
- <root id="test.spec.dir"/>
- </test-roots>
- </data>
- </configuration>
-</project>
View
38 spec/linebreak_spec.rb
@@ -1,21 +1,23 @@
-# Copyright 2009 Alexander E. Fischer <aef@raxys.net>
-#
-# This file is part of Linebreak.
-#
-# Linebreak is free software: you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation, either version 3 of the License, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program. If not, see <http://www.gnu.org/licenses/>.
-
-require 'spec/spec_helper'
+# encoding: UTF-8
+=begin
+Copyright Alexander E. Fischer <aef@raxys.net>, 2009-2012
+
+This file is part of Linebreak.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+=end
+
+require 'spec_helper'
describe Aef::Linebreak do
include LinebreakSpecHelper
View
75 spec/spec_helper.rb
@@ -1,28 +1,27 @@
-# Copyright 2009 Alexander E. Fischer <aef@raxys.net>
-#
-# This file is part of Linebreak.
-#
-# Linebreak is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+# encoding: UTF-8
+=begin
+Copyright Alexander E. Fischer <aef@raxys.net>, 2009-2012
+
+This file is part of Linebreak.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+=end
+
+require 'rspec'
require 'tempfile'
require 'rbconfig'
-require 'rubygems'
require 'popen4'
-
-$LOAD_PATH.unshift('lib')
-
-require 'aef/linebreak/string_extension'
+require 'linebreak'
module LinebreakSpecHelper
INTERPRETER = Pathname(RbConfig::CONFIG['bindir']) + RbConfig::CONFIG['ruby_install_name']
@@ -80,24 +79,24 @@ def version_message
<<-EOS
Linebreak #{Aef::Linebreak::VERSION}
-Project: https://rubyforge.org/projects/linebreak/
-RDoc: http://linebreak.rubyforge.org/
-Github: http://github.com/aef/linebreak/
+Project: https://github.com/aef/linebreak/
+Documentation: http://rubydoc.info/aef/linebreak/
-Copyright 2009 Alexander E. Fischer <aef@raxys.net>
+Copyright Alexander E. Fischer <aef@raxys.net>, 2009-2012
-Linebreak is free software: you can redistribute it and/or modify it under the
-terms of the GNU General Public License as published by the Free Software
-Foundation, either version 3 of the License, or (at your option) any later
-version.
+This file is part of Linebreak.
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-details.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-You should have received a copy of the GNU General Public License along with
-this program. If not, see <http://www.gnu.org/licenses/>.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
EOS
end
@@ -123,7 +122,7 @@ def env(environment = {})
end
end
-if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.8.7')
+if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('1.8.7')
warn %{\nThe 16 specs of the "encodings" methods fail on 1.8.6 and } +
'below because of invalid hash comparison which affects ' +
'comparison of the result Sets. This should not be a big problem.'
@@ -135,6 +134,6 @@ def env(environment = {})
'commandline tool should still work fine.'
end
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
config.include LinebreakSpecHelper
end
Please sign in to comment.
Something went wrong with that request. Please try again.