highlander 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +6 -1
- data/README +2 -2
- data/highlander.gemspec +15 -16
- data/lib/highlander.rb +12 -12
- data/test/test_highlander.rb +1 -1
- metadata +39 -55
    
        data/CHANGES
    CHANGED
    
    
    
        data/README
    CHANGED
    
    | @@ -6,7 +6,7 @@ | |
| 6 6 | 
             
              gem install highlander
         | 
| 7 7 |  | 
| 8 8 | 
             
            = Synopsis
         | 
| 9 | 
            -
              require 'highlander'
         | 
| 9 | 
            +
              require 'highlander' # This should be the -first- thing in your code.
         | 
| 10 10 | 
             
              # Your code here
         | 
| 11 11 |  | 
| 12 12 | 
             
              # Meanwhile, back on the command line...
         | 
| @@ -33,7 +33,7 @@ | |
| 33 33 | 
             
              Artistic 2.0
         | 
| 34 34 |  | 
| 35 35 | 
             
            = Copyright
         | 
| 36 | 
            -
              (C) 2010 Daniel J. Berger
         | 
| 36 | 
            +
              (C) 2010-2013 Daniel J. Berger
         | 
| 37 37 | 
             
              All Rights Reserved.
         | 
| 38 38 |  | 
| 39 39 | 
             
            == Warranty
         | 
    
        data/highlander.gemspec
    CHANGED
    
    | @@ -1,25 +1,24 @@ | |
| 1 1 | 
             
            require 'rubygems'
         | 
| 2 2 |  | 
| 3 | 
            -
            Gem::Specification.new do | | 
| 4 | 
            -
               | 
| 5 | 
            -
               | 
| 6 | 
            -
               | 
| 7 | 
            -
               | 
| 8 | 
            -
               | 
| 9 | 
            -
               | 
| 10 | 
            -
               | 
| 11 | 
            -
               | 
| 12 | 
            -
               | 
| 13 | 
            -
              gem.files      = Dir['**/*'].reject{ |f| f.include?('git') }
         | 
| 3 | 
            +
            Gem::Specification.new do |spec|
         | 
| 4 | 
            +
              spec.name       = 'highlander'
         | 
| 5 | 
            +
              spec.version    = '0.1.1'
         | 
| 6 | 
            +
              spec.license    = 'Artistic 2.0'
         | 
| 7 | 
            +
              spec.author     = 'Daniel J. Berger'
         | 
| 8 | 
            +
              spec.email      = 'djberg96@gmail.com'
         | 
| 9 | 
            +
              spec.homepage   = 'https://github.com/djberg96/highlander'
         | 
| 10 | 
            +
              spec.summary    = 'There can be only one! Process, that is.'
         | 
| 11 | 
            +
              spec.test_files = Dir['test/test*']
         | 
| 12 | 
            +
              spec.files      = Dir['**/*'].reject{ |f| f.include?('git') }
         | 
| 14 13 |  | 
| 15 | 
            -
               | 
| 16 | 
            -
               | 
| 14 | 
            +
              spec.rubyforge_project = 'shards'
         | 
| 15 | 
            +
              spec.extra_rdoc_files  = ['README', 'CHANGES', 'MANIFEST']
         | 
| 17 16 |  | 
| 18 | 
            -
               | 
| 19 | 
            -
                The highlander  | 
| 17 | 
            +
              spec.description = <<-EOF
         | 
| 18 | 
            +
                The highlander spec ensures that only once instance of the current
         | 
| 20 19 | 
             
                process is running. If you try to run the same Ruby program again
         | 
| 21 20 | 
             
                it will raise a RuntimeError instead.
         | 
| 22 21 | 
             
              EOF
         | 
| 23 22 |  | 
| 24 | 
            -
               | 
| 23 | 
            +
              spec.add_development_dependency('test-unit', '>= 2.1.1')
         | 
| 25 24 | 
             
            end
         | 
    
        data/lib/highlander.rb
    CHANGED
    
    | @@ -1,19 +1,19 @@ | |
| 1 1 | 
             
            module Highlander
         | 
| 2 2 | 
             
              # The version of the highlander library
         | 
| 3 | 
            -
              VERSION = '0.1. | 
| 3 | 
            +
              VERSION = '0.1.1'
         | 
| 4 | 
            +
            end
         | 
| 4 5 |  | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 6 | 
            +
            BEGIN{
         | 
| 7 | 
            +
              unless $PROGRAM_NAME == 'irb' || $PROGRAM_NAME == 'jirb'
         | 
| 8 | 
            +
                program = File.expand_path($PROGRAM_NAME)
         | 
| 9 | 
            +
                DATA = File.open(program) unless defined?(DATA)
         | 
| 10 | 
            +
                status = DATA.flock(File::LOCK_EX | File::LOCK_NB)
         | 
| 10 11 |  | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
                  end
         | 
| 12 | 
            +
                if status != 0
         | 
| 13 | 
            +
                  raise RuntimeError, "Program '#{program}' already running"
         | 
| 14 | 
            +
                  exit! # In case of rescue, forcibly bail
         | 
| 15 15 | 
             
                end
         | 
| 16 | 
            -
               | 
| 17 | 
            -
             | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
            }
         | 
| 18 18 |  | 
| 19 19 | 
             
            include Highlander
         | 
    
        data/test/test_highlander.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,50 +1,43 @@ | |
| 1 | 
            -
            --- !ruby/object:Gem::Specification | 
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: highlander
         | 
| 3 | 
            -
            version: !ruby/object:Gem::Version | 
| 4 | 
            -
               | 
| 5 | 
            -
              prerelease:  | 
| 6 | 
            -
              segments: 
         | 
| 7 | 
            -
              - 0
         | 
| 8 | 
            -
              - 1
         | 
| 9 | 
            -
              - 0
         | 
| 10 | 
            -
              version: 0.1.0
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.1.1
         | 
| 5 | 
            +
              prerelease: 
         | 
| 11 6 | 
             
            platform: ruby
         | 
| 12 | 
            -
            authors: | 
| 7 | 
            +
            authors:
         | 
| 13 8 | 
             
            - Daniel J. Berger
         | 
| 14 9 | 
             
            autorequire: 
         | 
| 15 10 | 
             
            bindir: bin
         | 
| 16 11 | 
             
            cert_chain: []
         | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
            dependencies: 
         | 
| 21 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 12 | 
            +
            date: 2013-01-23 00:00:00.000000000 Z
         | 
| 13 | 
            +
            dependencies:
         | 
| 14 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 22 15 | 
             
              name: test-unit
         | 
| 23 | 
            -
               | 
| 24 | 
            -
              requirement: &id001 !ruby/object:Gem::Requirement 
         | 
| 16 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 25 17 | 
             
                none: false
         | 
| 26 | 
            -
                requirements: | 
| 27 | 
            -
                - -  | 
| 28 | 
            -
                  - !ruby/object:Gem::Version | 
| 29 | 
            -
                    hash: 9
         | 
| 30 | 
            -
                    segments: 
         | 
| 31 | 
            -
                    - 2
         | 
| 32 | 
            -
                    - 1
         | 
| 33 | 
            -
                    - 1
         | 
| 18 | 
            +
                requirements:
         | 
| 19 | 
            +
                - - ! '>='
         | 
| 20 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 34 21 | 
             
                    version: 2.1.1
         | 
| 35 22 | 
             
              type: :development
         | 
| 36 | 
            -
               | 
| 37 | 
            -
             | 
| 23 | 
            +
              prerelease: false
         | 
| 24 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 25 | 
            +
                none: false
         | 
| 26 | 
            +
                requirements:
         | 
| 27 | 
            +
                - - ! '>='
         | 
| 28 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 29 | 
            +
                    version: 2.1.1
         | 
| 30 | 
            +
            description: ! "    The highlander spec ensures that only once instance of the current\n
         | 
| 31 | 
            +
              \   process is running. If you try to run the same Ruby program again\n    it will
         | 
| 32 | 
            +
              raise a RuntimeError instead.\n"
         | 
| 38 33 | 
             
            email: djberg96@gmail.com
         | 
| 39 34 | 
             
            executables: []
         | 
| 40 | 
            -
             | 
| 41 35 | 
             
            extensions: []
         | 
| 42 | 
            -
             | 
| 43 | 
            -
            extra_rdoc_files: 
         | 
| 36 | 
            +
            extra_rdoc_files:
         | 
| 44 37 | 
             
            - README
         | 
| 45 38 | 
             
            - CHANGES
         | 
| 46 39 | 
             
            - MANIFEST
         | 
| 47 | 
            -
            files: | 
| 40 | 
            +
            files:
         | 
| 48 41 | 
             
            - CHANGES
         | 
| 49 42 | 
             
            - highlander.gemspec
         | 
| 50 43 | 
             
            - lib/highlander.rb
         | 
| @@ -52,39 +45,30 @@ files: | |
| 52 45 | 
             
            - Rakefile
         | 
| 53 46 | 
             
            - README
         | 
| 54 47 | 
             
            - test/test_highlander.rb
         | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
            licenses: 
         | 
| 48 | 
            +
            homepage: https://github.com/djberg96/highlander
         | 
| 49 | 
            +
            licenses:
         | 
| 58 50 | 
             
            - Artistic 2.0
         | 
| 59 51 | 
             
            post_install_message: 
         | 
| 60 52 | 
             
            rdoc_options: []
         | 
| 61 | 
            -
             | 
| 62 | 
            -
            require_paths: 
         | 
| 53 | 
            +
            require_paths:
         | 
| 63 54 | 
             
            - lib
         | 
| 64 | 
            -
            required_ruby_version: !ruby/object:Gem::Requirement | 
| 55 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 65 56 | 
             
              none: false
         | 
| 66 | 
            -
              requirements: | 
| 67 | 
            -
              - -  | 
| 68 | 
            -
                - !ruby/object:Gem::Version | 
| 69 | 
            -
                   | 
| 70 | 
            -
             | 
| 71 | 
            -
                  - 0
         | 
| 72 | 
            -
                  version: "0"
         | 
| 73 | 
            -
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 57 | 
            +
              requirements:
         | 
| 58 | 
            +
              - - ! '>='
         | 
| 59 | 
            +
                - !ruby/object:Gem::Version
         | 
| 60 | 
            +
                  version: '0'
         | 
| 61 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 74 62 | 
             
              none: false
         | 
| 75 | 
            -
              requirements: | 
| 76 | 
            -
              - -  | 
| 77 | 
            -
                - !ruby/object:Gem::Version | 
| 78 | 
            -
                   | 
| 79 | 
            -
                  segments: 
         | 
| 80 | 
            -
                  - 0
         | 
| 81 | 
            -
                  version: "0"
         | 
| 63 | 
            +
              requirements:
         | 
| 64 | 
            +
              - - ! '>='
         | 
| 65 | 
            +
                - !ruby/object:Gem::Version
         | 
| 66 | 
            +
                  version: '0'
         | 
| 82 67 | 
             
            requirements: []
         | 
| 83 | 
            -
             | 
| 84 68 | 
             
            rubyforge_project: shards
         | 
| 85 | 
            -
            rubygems_version: 1. | 
| 69 | 
            +
            rubygems_version: 1.8.24
         | 
| 86 70 | 
             
            signing_key: 
         | 
| 87 71 | 
             
            specification_version: 3
         | 
| 88 72 | 
             
            summary: There can be only one! Process, that is.
         | 
| 89 | 
            -
            test_files: | 
| 73 | 
            +
            test_files:
         | 
| 90 74 | 
             
            - test/test_highlander.rb
         |