File: ruby_debian_dev.rb

package info (click to toggle)
ruby-defaults 1%3A2.1.5%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 108 kB
  • ctags: 4
  • sloc: sh: 47; ruby: 41; makefile: 13
file content (42 lines) | stat: -rw-r--r-- 1,332 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
module RubyDebianDev

  RUBY_INTERPRETERS = {
    'ruby2.1' => {
      version:             '2.1',
      binary:              '/usr/bin/ruby2.1',
      api_version:         '2.1.0',
      shared_library:      'libruby2.1',
      min_ruby_dependency: 'ruby (>= 1:2.1)',
    },
  }

  def self.min_ruby_dependency_for(shared_library)
    RUBY_INTERPRETERS.each do |int,data|
      if data[:shared_library] == shared_library
        return data[:min_ruby_dependency]
      end
    end
    return nil
  end

  #################################################################
  # These constants below are kept here for backwards compatibility
  #################################################################
  SUPPORTED_RUBY_VERSIONS = RUBY_INTERPRETERS.keys.inject({}) do |supported,interpreter|
    supported[interpreter] = RUBY_INTERPRETERS[interpreter][:binary]
    supported
  end

  RUBY_CONFIG_VERSION = RUBY_INTERPRETERS.keys.inject({}) do |supported,interpreter|
    supported[interpreter] = RUBY_INTERPRETERS[interpreter][:version]
    supported
  end

  RUBY_API_VERSION = RUBY_INTERPRETERS.keys.inject({}) do |supported,interpreter|
    supported[interpreter] = RUBY_INTERPRETERS[interpreter][:api_version]
    supported
  end

  SUPPORTED_RUBY_SHARED_LIBRARIES = RUBY_INTERPRETERS.map { |k,v| v[:shared_library] }

end