Static Public Member Functions | |
| static void | RunThread (Action constructor) |
| Construct a new scope which runs in a new thread. When this scope ends, the thread's scope is ended, and the thread is terminated. More... | |
| static void | RunThreadWhilst (ICellRead< bool > threadActivity, Action constructor) |
| A combination of the Whilst and Thread operations, provided as a single method for code clarity. This is equivalent to calling Thread() inside a Whilst() operation. Note that this is slightly different to reversing the order and calling Whilst() inside a Thread() operation. The former is used because it does not require any synchronization of the threadActivity argument, and minimizes resource usage when the threadActivity cell is false. More... | |
| static void | Lock< T > (IShared< T > s1, Action< T > handler) |
| Lock a shared variable for exclusive access. If the variable is already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block. More... | |
| static void | Lock< T1, T2 > (IShared< T1 > s1, IShared< T2 > s2, Action< T1, T2 > handler) |
| Lock shared variables for exclusive access. If any of the variables are already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block. More... | |
| static void | Lock< T1, T2, T3 > (IShared< T1 > s1, IShared< T2 > s2, IShared< T3 > s3, Action< T1, T2, T3 > handler) |
| Lock shared variables for exclusive access. If any of the variables are already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block. More... | |
| static void | Lock< T1, T2, T3, T4 > (IShared< T1 > s1, IShared< T2 > s2, IShared< T3 > s3, IShared< T4 > s4, Action< T1, T2, T3, T4 > handler) |
| Lock shared variables for exclusive access. If any of the variables are already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block. More... | |
| static ICellRead< T > | WatchOnCurrentThread< T > (IShared< MemoryCell< T >> sharedCell) |
| Observe a shared value on the current thread. A copy of the current value in the cell is kept on the calling thread, so the current value can always be read without locking. More... | |
| static IListCellRead< T > | WatchOnCurrentThread< T > (IShared< IListCellRead< T >> sharedCell) |
| Observe a shared value on the current thread. A copy of the current value in the cell is kept on the calling thread, so the current value can always be read without locking. More... | |
|
inlinestatic |
Lock a shared variable for exclusive access. If the variable is already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block.
| T | The type of the shared variable. |
| s1 | The shared variable |
| handler | The handler to invoke after a lock is obtained. |
|
inlinestatic |
Lock shared variables for exclusive access. If any of the variables are already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block.
| T1 | The type of the first shared variable. |
| T2 | The type of the second shared variable. |
| s1 | The first shared variable |
| s2 | The second shared variable |
| handler | The handler to invoke after a lock is obtained. |
|
inlinestatic |
Lock shared variables for exclusive access. If any of the variables are already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block.
| T1 | The type of the first shared variable. |
| T2 | The type of the second shared variable. |
| T3 | The type of the third shared variable. |
| s1 | The first shared variable |
| s2 | The second shared variable |
| s3 | The third shared variable |
| handler | The handler to invoke after a lock is obtained. |
|
inlinestatic |
Lock shared variables for exclusive access. If any of the variables are already locked, the handler will be put in a queue until a lock can be obtained. This should only be called from a sequential block.
| T1 | The type of the first shared variable. |
| T2 | The type of the second shared variable. |
| T3 | The type of the third shared variable. |
| T4 | The type of the fourth shared variable. |
| s1 | The first shared variable |
| s2 | The second shared variable |
| s3 | The third shared variable |
| s4 | The fourth shared variable |
| handler | The handler to invoke after a lock is obtained. |
|
inlinestatic |
Construct a new scope which runs in a new thread. When this scope ends, the thread's scope is ended, and the thread is terminated.
| constructor | The constructor for the thread's top-level scope. |
|
inlinestatic |
A combination of the Whilst and Thread operations, provided as a single method for code clarity. This is equivalent to calling Thread() inside a Whilst() operation. Note that this is slightly different to reversing the order and calling Whilst() inside a Thread() operation. The former is used because it does not require any synchronization of the threadActivity argument, and minimizes resource usage when the threadActivity cell is false.
| threadActivity | The condition cell. |
| constructor | The constructor for the thread's top-level scope. |
|
inlinestatic |
Observe a shared value on the current thread. A copy of the current value in the cell is kept on the calling thread, so the current value can always be read without locking.
| T |
| sharedCell |
|
inlinestatic |
Observe a shared value on the current thread. A copy of the current value in the cell is kept on the calling thread, so the current value can always be read without locking.
| T |
| sharedCell |


module Gem
RubyGems is the Ruby standard for publishing and managing third party libraries.
For user documentation, see:
-
gem help
andgem help [command]
For gem developer documentation see:
-
Gem::Version for version dependency notes
Further RubyGems documentation can be found at:
-
RubyGems API (also available from
gem server
)
RubyGems Plugins¶ ↑
As of RubyGems 1.3.2, RubyGems will load plugins installed in gems or $LOAD_PATH. Plugins must be named 'rubygems_plugin' (.rb, .so, etc) and placed at the root of your gem's require_path. Plugins are discovered via ::find_files then loaded. Take care when implementing a plugin as your plugin file may be loaded multiple times if multiple versions of your gem are installed.
For an example plugin, see the graph gem which adds a `gem graph` command.
RubyGems Defaults, Packaging¶ ↑
RubyGems defaults are stored in rubygems/defaults.rb. If you're packaging RubyGems or implementing Ruby you can change RubyGems' defaults.
For RubyGems packagers, provide lib/rubygems/defaults/operating_system.rb and override any defaults from lib/rubygems/defaults.rb.
For Ruby implementers, provide lib/rubygems/defaults/#{RUBY_ENGINE}.rb and override any defaults from lib/rubygems/defaults.rb.
If you need RubyGems to perform extra work on install or uninstall, your defaults override file can set pre and post install and uninstall hooks. See ::pre_install, ::pre_uninstall, ::post_install, ::post_uninstall.
Bugs¶ ↑
You can submit bugs to the RubyGems bug tracker on GitHub
Credits¶ ↑
RubyGems is currently maintained by Eric Hodel.
RubyGems was originally developed at RubyConf 2003 by:
-
Rich Kilmer – rich(at)infoether.com
-
Chad Fowler – chad(at)chadfowler.com
-
David Black – dblack(at)wobblini.net
-
Paul Brannan – paul(at)atdesk.com
-
Jim Weirich – jim(at)weirichhouse.org
Contributors:
-
Gavin Sinclair – gsinclair(at)soyabean.com.au
-
George Marrows – george.marrows(at)ntlworld.com
-
Dick Davies – rasputnik(at)hellooperator.net
-
Mauricio Fernandez – batsman.geo(at)yahoo.com
-
Simon Strandgaard – neoneye(at)adslhome.dk
-
Dave Glasser – glasser(at)mit.edu
-
Paul Duncan – pabs(at)pablotron.org
-
Ville Aine – vaine(at)cs.helsinki.fi
-
Eric Hodel – drbrain(at)segment7.net
-
Daniel Berger – djberg96(at)gmail.com
-
Phil Hagelberg – technomancy(at)gmail.com
-
Ryan Davis – ryand-ruby(at)zenspider.com
-
Evan Phoenix – evan(at)fallingsnow.net
-
Steve Klabnik – steve(at)steveklabnik.com
(If your name is missing, PLEASE let us know!)
See LICENSE.txt for permissions.
Thanks!
-The RubyGems Team
Constants
- DEFAULT_HOST
- GEM_DEP_FILES
- LOADED_SPECS_MUTEX
- MARSHAL_SPEC_DIR
Location of Marshal quick gemspecs on remote repositories
- RDoc
Gem::RDoc provides methods to generate RDoc and ri data for installed gems upon gem installation.
This file is automatically required by RubyGems 1.9 and newer.
- READ_BINARY_ERRORS
Exception classes used in a ::read_binary
rescue
statement. Not all of these are defined in Ruby 1.8.7, hence the need for this convoluted setup.- REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES
Subdirectories in a gem repository for default gems
- REPOSITORY_SUBDIRECTORIES
Subdirectories in a gem repository
- RUBYGEMS_DIR
- VERSION
- WIN_PATTERNS
An Array of Regexps that match windows Ruby platforms.
- WRITE_BINARY_ERRORS
Exception classes used in ::write_binary
rescue
statement. Not all of these are defined in Ruby 1.8.7.
Attributes
The list of hooks to be run after Gem::DependencyInstaller installs a set of gems
GemDependencyAPI object, which is set when .use_gemdeps is called. This contains all the information from the Gemfile.
Hash of loaded Gem::Specification keyed by name
The list of hooks to be run after Gem::Installer#install extracts files and builds extensions
The list of hooks to be run after Gem::Installer#install completes installation
The list of hooks to be run after Gem::Specification.reset is run.
The list of hooks to be run after Gem::Uninstaller#uninstall completes installation
The list of hooks to be run before Gem::Installer#install does any work
The list of hooks to be run before Gem::Specification.reset is run.
The list of hooks to be run before Gem::Uninstaller#uninstall does any work
Public Class Methods
Find the full path to the executable for gem
name
. If the exec_name
is not given, the
gem's default_executable is chosen, otherwise the specified
executable's path is returned. requirements
allows you to
specify specific gem versions.
# File lib/rubygems.rb, line 248 def self.bin_path(name, exec_name = nil, *requirements) # TODO: fails test_self_bin_path_bin_file_gone_in_latest # Gem::Specification.find_by_name(name, *requirements).bin_file exec_name raise ArgumentError, "you must supply exec_name" unless exec_name requirements = Gem::Requirement.default if requirements.empty? find_spec_for_exe(name, exec_name, requirements).bin_file exec_name end
The mode needed to read a file as straight binary.
# File lib/rubygems.rb, line 305 def self.binary_mode 'rb' end
The path where gem executables are to be installed.
# File lib/rubygems.rb, line 312 def self.bindir(install_dir=Gem.dir) return File.join install_dir, 'bin' unless install_dir.to_s == Gem.default_dir.to_s Gem.default_bindir end
Clear default gem related variables. It is for test
# File lib/rubygems.rb, line 1261 def clear_default_specs @path_to_default_spec_map.clear end
Reset the dir
and path
values. The next time
dir
or path
is requested, the values will be
calculated from scratch. This is mainly used by the unit tests to provide
test isolation.
# File lib/rubygems.rb, line 323 def self.clear_paths @paths = nil @user_home = nil Gem::Specification.reset Gem::Security.reset if defined?(Gem::Security) end
The path to standard location of the user's .gemrc file.
# File lib/rubygems.rb, line 333 def self.config_file @config_file ||= File.join Gem.user_home, '.gemrc' end
The standard configuration object for gems.
# File lib/rubygems.rb, line 340 def self.configuration @configuration ||= Gem::ConfigFile.new [] end
Use the given configuration object (which implements the ConfigFile protocol) as the standard configuration object.
# File lib/rubygems.rb, line 348 def self.configuration=(config) @configuration = config end
The path to the data directory specified by the gem name. If the package is not available as a gem, return nil.
# File lib/rubygems.rb, line 356 def self.datadir(gem_name) # TODO: deprecate spec = @loaded_specs[gem_name] return nil if spec.nil? spec.datadir end
The default directory for binaries
# File lib/rubygems/defaults.rb, line 116 def self.default_bindir if defined? RUBY_FRAMEWORK_VERSION then # mac framework support '/usr/bin' else # generic install RbConfig::CONFIG['bindir'] end end
The default signing certificate chain path
# File lib/rubygems/defaults.rb, line 145 def self.default_cert_path File.join Gem.user_home, ".gem", "gem-public_cert.pem" end
Default home directory path to be used if an alternate value is not specified in the environment
# File lib/rubygems/defaults.rb, line 29 def self.default_dir path = if defined? RUBY_FRAMEWORK_VERSION then [ File.dirname(RbConfig::CONFIG['sitedir']), 'Gems', RbConfig::CONFIG['ruby_version'] ] elsif RbConfig::CONFIG['rubylibprefix'] then [ RbConfig::CONFIG['rubylibprefix'], 'gems', RbConfig::CONFIG['ruby_version'] ] else [ RbConfig::CONFIG['libdir'], ruby_engine, 'gems', RbConfig::CONFIG['ruby_version'] ] end @default_dir ||= File.join(*path) end
Deduce Ruby's –program-prefix and –program-suffix from its install name
# File lib/rubygems/defaults.rb, line 102 def self.default_exec_format exec_format = RbConfig::CONFIG['ruby_install_name'].sub('ruby', '%s') rescue '%s' unless exec_format =~ /%s/ then raise Gem::Exception, "[BUG] invalid exec_format #{exec_format.inspect}, no %s" end exec_format end
Returns binary extensions dir for specified RubyGems base dir or nil if such directory cannot be determined.
By default, the binary extensions are located side by side with their Ruby counterparts, therefore nil is returned
# File lib/rubygems/defaults.rb, line 61 def self.default_ext_dir_for base_dir nil end
Whether to expect full paths in default gems - true for non-MRI ruby implementations
# File lib/rubygems/defaults.rb, line 152 def self.default_gems_use_full_paths? ruby_engine != 'ruby' end
The default signing key path
# File lib/rubygems/defaults.rb, line 138 def self.default_key_path File.join Gem.user_home, ".gem", "gem-private_key.pem" end
Default gem load path
# File lib/rubygems/defaults.rb, line 91 def self.default_path path = [] path << user_dir if user_home && File.exist?(user_home) path << default_dir path << vendor_dir if vendor_dir and File.directory? vendor_dir path end
Paths where RubyGems' .rb files and bin files are installed
# File lib/rubygems/defaults.rb, line 68 def self.default_rubygems_dirs nil # default to standard layout end
An Array of the default sources that come with RubyGems
# File lib/rubygems/defaults.rb, line 13 def self.default_sources %w[https://rubygems.org/] end
Default spec directory path to be used if an alternate value is not specified in the environment
# File lib/rubygems/defaults.rb, line 21 def self.default_spec_cache_dir File.join Gem.user_home, '.gem', 'specs' end
A Zlib::Deflate.deflate wrapper
# File lib/rubygems.rb, line 366 def self.deflate(data) require 'zlib' Zlib::Deflate.deflate data end
The path where gems are to be installed.
# File lib/rubygems.rb, line 416 def self.dir paths.home end
Adds a post-installs hook that will be passed a Gem::DependencyInstaller and a list of installed specifications when Gem::DependencyInstaller#install is complete
# File lib/rubygems.rb, line 775 def self.done_installing(&hook) @done_installing_hooks << hook end
Quietly ensure the Gem directory dir
contains all the proper
subdirectories for handling default gems. If we can't create a
directory due to a permission problem, then we will silently continue.
If mode
is given, missing directories are created with this
mode.
World-writable directories will never be created.
# File lib/rubygems.rb, line 450 def self.ensure_default_gem_subdirectories dir = Gem.dir, mode = nil ensure_subdirectories(dir, mode, REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES) end
Quietly ensure the Gem directory dir
contains all the proper
subdirectories. If we can't create a directory due to a permission
problem, then we will silently continue.
If mode
is given, missing directories are created with this
mode.
World-writable directories will never be created.
# File lib/rubygems.rb, line 437 def self.ensure_gem_subdirectories dir = Gem.dir, mode = nil ensure_subdirectories(dir, mode, REPOSITORY_SUBDIRECTORIES) end
# File lib/rubygems.rb, line 907 def self.env_requirement(gem_name) @env_requirements_by_name ||= {} @env_requirements_by_name[gem_name] ||= begin req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || '>= 0'.freeze Gem::Requirement.create(req) end end
Returns a list of paths matching glob
that can be used by a
gem to pick up features from other gems. For example:
Gem.find_files('rdoc/discover').each do |path| load path end
if check_load_path
is true (the default), then ::find_files also searches
$LOAD_PATH for files as well as gems.
Note that ::find_files will return all files even if they are from different versions of the same gem. See also ::find_latest_files
# File lib/rubygems.rb, line 497 def self.find_files(glob, check_load_path=true) files = [] files = find_files_from_load_path glob if check_load_path gem_specifications = @gemdeps ? Gem.loaded_specs.values : Gem::Specification.stubs files.concat gem_specifications.map { |spec| spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}") }.flatten # $LOAD_PATH might contain duplicate entries or reference # the spec dirs directly, so we prune. files.uniq! if check_load_path return files end
Returns a list of paths matching glob
from the latest gems
that can be used by a gem to pick up features from other gems. For
example:
Gem.find_latest_files('rdoc/discover').each do |path| load path end
if check_load_path
is true (the default), then ::find_latest_files also
searches $LOAD_PATH for files as well as gems.
Unlike ::find_files, ::find_latest_files will return only files from the latest version of a gem.
# File lib/rubygems.rb, line 533 def self.find_latest_files(glob, check_load_path=true) files = [] files = find_files_from_load_path glob if check_load_path files.concat Gem::Specification.latest_specs(true).map { |spec| spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}") }.flatten # $LOAD_PATH might contain duplicate entries or reference # the spec dirs directly, so we prune. files.uniq! if check_load_path return files end
Find a Gem::Specification of default gem from
path
# File lib/rubygems.rb, line 1240 def find_unresolved_default_spec(path) Gem.suffixes.each do |suffix| spec = @path_to_default_spec_map["#{path}#{suffix}"] return spec if spec end nil end
# File lib/rubygems.rb, line 233 def self.finish_resolve(request_set=Gem::RequestSet.new) request_set.import Gem::Specification.unresolved_deps.values request_set.import Gem.loaded_specs.values.map {|s| Gem::Dependency.new(s.name, s.version) } request_set.resolve_current.each do |s| s.full_spec.activate end end
Zlib::GzipReader wrapper that unzips
data
.
# File lib/rubygems.rb, line 594 def self.gunzip(data) require 'rubygems/util' Gem::Util.gunzip data end
Zlib::GzipWriter wrapper that zips
data
.
# File lib/rubygems.rb, line 602 def self.gzip(data) require 'rubygems/util' Gem::Util.gzip data end
Get the default RubyGems API host. This is normally
https://rubygems.org
.
# File lib/rubygems.rb, line 634 def self.host # TODO: move to utils @host ||= Gem::DEFAULT_HOST end
Set the default RubyGems API host.
# File lib/rubygems.rb, line 641 def self.host= host # TODO: move to utils @host = host end
A Zlib::Inflate#inflate wrapper
# File lib/rubygems.rb, line 610 def self.inflate(data) require 'rubygems/util' Gem::Util.inflate data end
Top level install helper method. Allows you to install gems interactively:
% irb >> Gem.install "minitest" Fetching: minitest-3.0.1.gem (100%) => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
# File lib/rubygems.rb, line 623 def self.install name, version = Gem::Requirement.default, *options require "rubygems/dependency_installer" inst = Gem::DependencyInstaller.new(*options) inst.install name, version inst.installed_gems end
Returns the latest release version of RubyGems.
# File lib/rubygems.rb, line 932 def self.latest_rubygems_version latest_version_for('rubygems-update') or raise "Can't find 'rubygems-update' in any repo. Check `gem source list`." end
Returns the latest release-version specification for the gem
name
.
# File lib/rubygems.rb, line 919 def self.latest_spec_for name dependency = Gem::Dependency.new name fetcher = Gem::SpecFetcher.fetcher spec_tuples, = fetcher.spec_for_dependency dependency spec, = spec_tuples.first spec end
Returns the version of the latest release-version of gem name
# File lib/rubygems.rb, line 940 def self.latest_version_for name spec = latest_spec_for name spec and spec.version end
Find all 'rubygems_plugin' files in $LOAD_PATH and load them
# File lib/rubygems.rb, line 1106 def self.load_env_plugins path = "rubygems_plugin" files = [] $LOAD_PATH.each do |load_path| globbed = Dir["#{File.expand_path path, load_path}#{Gem.suffix_pattern}"] globbed.each do |load_path_file| files << load_path_file if File.file?(load_path_file.untaint) end end load_plugin_files files end
The index to insert activated gem paths into the $LOAD_PATH. The activated gem's paths are inserted before site lib directory by default.
# File lib/rubygems.rb, line 650 def self.load_path_insert_index $LOAD_PATH.each_with_index do |path, i| return i if path.instance_variable_defined?(:@gem_prelude_index) end index = $LOAD_PATH.index RbConfig::CONFIG['sitelibdir'] index end
Find the 'rubygems_plugin' files in the latest installed gems and load them
# File lib/rubygems.rb, line 1094 def self.load_plugins # Remove this env var by at least 3.0 if ENV['RUBYGEMS_LOAD_ALL_PLUGINS'] load_plugin_files find_files('rubygems_plugin', false) else load_plugin_files find_latest_files('rubygems_plugin', false) end end
Loads YAML, preferring Psych
# File lib/rubygems.rb, line 665 def self.load_yaml return if @yaml_loaded return unless defined?(gem) test_syck = ENV['TEST_SYCK'] # Only Ruby 1.8 and 1.9 have syck test_syck = false unless /^1\./ =~ RUBY_VERSION unless test_syck begin gem 'psych', '>= 2.0.0' rescue Gem::LoadError # It's OK if the user does not have the psych gem installed. We will # attempt to require the stdlib version end begin # Try requiring the gem version *or* stdlib version of psych. require 'psych' rescue ::LoadError # If we can't load psych, thats fine, go on. else # If 'yaml' has already been required, then we have to # be sure to switch it over to the newly loaded psych. if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != "psych" YAML::ENGINE.yamler = "psych" end require 'rubygems/psych_additions' require 'rubygems/psych_tree' end end require 'yaml' require 'rubygems/safe_yaml' # If we're supposed to be using syck, then we may have to force # activate it via the YAML::ENGINE API. if test_syck and defined?(YAML::ENGINE) YAML::ENGINE.yamler = "syck" unless YAML::ENGINE.syck? end # Now that we're sure some kind of yaml library is loaded, pull # in our hack to deal with Syck's DefaultKey ugliness. require 'rubygems/syck_hack' @yaml_loaded = true end
The file name and line number of the caller of the caller of this method.
# File lib/rubygems.rb, line 718 def self.location_of_caller caller[1] =~ /(.*?):(\d+).*?$/i file = $1 lineno = $2.to_i [file, lineno] end
The version of the Marshal format for your Ruby.
# File lib/rubygems.rb, line 729 def self.marshal_version "#{Marshal::MAJOR_VERSION}.#{Marshal::MINOR_VERSION}" end
# File lib/rubygems.rb, line 225 def self.needs rs = Gem::RequestSet.new yield rs finish_resolve rs end
# File lib/rubygems.rb, line 420 def self.path paths.path end
How String Gem paths should be split. Overridable for esoteric platforms.
# File lib/rubygems/defaults.rb, line 84 def self.path_separator File::PATH_SEPARATOR end
Retrieve the PathSupport object that RubyGems uses to lookup files.
# File lib/rubygems.rb, line 374 def self.paths @paths ||= Gem::PathSupport.new(ENV) end
Initialize the filesystem paths to use from env
.
env
is a hash-like object (typically ENV) that is queried for 'GEM_HOME',
'GEM_PATH', and 'GEM_SPEC_CACHE' Keys for the
env
hash should be Strings, and values of the hash should be
Strings or nil
.
# File lib/rubygems.rb, line 384 def self.paths=(env) clear_paths target = {} env.each_pair do |k,v| case k when 'GEM_HOME', 'GEM_PATH', 'GEM_SPEC_CACHE' case v when nil, String target[k] = v when Array unless Gem::Deprecate.skip warn <<-eowarn Array values in the parameter to `Gem.paths=` are deprecated. Please use a String or nil. An Array (#{env.inspect}) was passed in from #{caller[3]} eowarn end target[k] = v.join File::PATH_SEPARATOR end else target[k] = v end end @paths = Gem::PathSupport.new ENV.to_hash.merge(target) Gem::Specification.dirs = @paths.path end
Default options for gem commands.
The options here should be structured as an array of string “gem” command names as keys and a string of the default options as values.
Example:
def self.platform_defaults
{ 'install' => '--no-rdoc --no-ri --env-shebang', 'update' => '--no-rdoc --no-ri --env-shebang' }
end
# File lib/rubygems/defaults.rb, line 192 def self.platform_defaults {} end
Array of platforms this RubyGems supports.
# File lib/rubygems.rb, line 743 def self.platforms @platforms ||= [] if @platforms.empty? @platforms = [Gem::Platform::RUBY, Gem::Platform.local] end @platforms end
Set array of platforms this RubyGems supports (primarily for testing).
# File lib/rubygems.rb, line 736 def self.platforms=(platforms) @platforms = platforms end
Adds a post-build hook that will be passed an Gem::Installer instance when Gem::Installer#install is
called. The hook is called after the gem has been extracted and extensions
have been built but before the executables or gemspec has been written. If
the hook returns false
then the gem's files will be
removed and the install will be aborted.
# File lib/rubygems.rb, line 758 def self.post_build(&hook) @post_build_hooks << hook end
Adds a post-install hook that will be passed an Gem::Installer instance when Gem::Installer#install is called
# File lib/rubygems.rb, line 766 def self.post_install(&hook) @post_install_hooks << hook end
Adds a hook that will get run after Gem::Specification.reset is run.
# File lib/rubygems.rb, line 783 def self.post_reset(&hook) @post_reset_hooks << hook end
Adds a post-uninstall hook that will be passed a Gem::Uninstaller instance and the spec that was uninstalled when Gem::Uninstaller#uninstall is called
# File lib/rubygems.rb, line 792 def self.post_uninstall(&hook) @post_uninstall_hooks << hook end
Adds a pre-install hook that will be passed an Gem::Installer instance when Gem::Installer#install is
called. If the hook returns false
then the install will be
aborted.
# File lib/rubygems.rb, line 801 def self.pre_install(&hook) @pre_install_hooks << hook end
Adds a hook that will get run before Gem::Specification.reset is run.
# File lib/rubygems.rb, line 809 def self.pre_reset(&hook) @pre_reset_hooks << hook end
Adds a pre-uninstall hook that will be passed an Gem::Uninstaller instance and the spec that will be uninstalled when Gem::Uninstaller#uninstall is called
# File lib/rubygems.rb, line 818 def self.pre_uninstall(&hook) @pre_uninstall_hooks << hook end
The directory prefix this RubyGems was installed at. If your prefix is in a standard location (ie, rubygems is installed where you'd expect it to be), then prefix returns nil.
# File lib/rubygems.rb, line 827 def self.prefix prefix = File.dirname RUBYGEMS_DIR if prefix != File.expand_path(RbConfig::CONFIG['sitelibdir']) and prefix != File.expand_path(RbConfig::CONFIG['libdir']) and 'lib' == File.basename(RUBYGEMS_DIR) then prefix end end
Safely read a file in binary mode on all platforms.
# File lib/rubygems.rb, line 847 def self.read_binary(path) open path, 'rb+' do |f| f.flock(File::LOCK_EX) f.read end rescue *READ_BINARY_ERRORS open path, 'rb' do |f| f.read end rescue Errno::ENOLCK # NFS if Thread.main != Thread.current raise else open path, 'rb' do |f| f.read end end end
Refresh available gems from disk.
# File lib/rubygems.rb, line 840 def self.refresh Gem::Specification.reset end
Register a Gem::Specification for default gem.
Two formats for the specification are supported:
-
MRI 2.0 style, where spec.files contains unprefixed require names. The spec's filenames will be registered as-is.
-
New style, where spec.files contains files prefixed with paths from spec.require_paths. The prefixes are stripped before registering the spec's filenames. Unprefixed files are omitted.
# File lib/rubygems.rb, line 1219 def register_default_spec(spec) new_format = Gem.default_gems_use_full_paths? || spec.require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } } if new_format prefix_group = spec.require_paths.map {|f| f + "/"}.join("|") prefix_pattern = /^(#{prefix_group})/ end spec.files.each do |file| if new_format file = file.sub(prefix_pattern, "") next unless $~ end @path_to_default_spec_map[file] = spec end end
Remove needless Gem::Specification of default gem from unresolved default gem list
# File lib/rubygems.rb, line 1252 def remove_unresolved_default_spec(spec) spec.files.each do |file| @path_to_default_spec_map.delete(file) end end
The path to the running Ruby interpreter.
# File lib/rubygems.rb, line 889 def self.ruby if @ruby.nil? then @ruby = File.join(RbConfig::CONFIG['bindir'], "#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}") @ruby = "\"#{@ruby}\"" if @ruby =~ /\s/ end @ruby end
Allows setting path to Ruby. This method is available when requiring 'rubygems/test_case'
# File lib/rubygems/test_case.rb, line 64 def self.ruby= ruby @ruby = ruby end
Returns a String containing the API compatibility version of Ruby
# File lib/rubygems.rb, line 903 def self.ruby_api_version @ruby_api_version ||= RbConfig::CONFIG['ruby_version'].dup end
A wrapper around RUBY_ENGINE const that may not be defined
# File lib/rubygems/defaults.rb, line 127 def self.ruby_engine if defined? RUBY_ENGINE then RUBY_ENGINE else 'ruby' end end
A Gem::Version for the currently running Ruby.
# File lib/rubygems.rb, line 948 def self.ruby_version return @ruby_version if defined? @ruby_version version = RUBY_VERSION.dup if defined?(RUBY_PATCHLEVEL) && RUBY_PATCHLEVEL != -1 then version << ".#{RUBY_PATCHLEVEL}" elsif defined?(RUBY_REVISION) then version << ".dev.#{RUBY_REVISION}" end @ruby_version = Gem::Version.new version end
A Gem::Version for the currently running RubyGems
# File lib/rubygems.rb, line 964 def self.rubygems_version return @rubygems_version if defined? @rubygems_version @rubygems_version = Gem::Version.new Gem::VERSION end
Allows setting the gem path searcher. This method is available when requiring 'rubygems/test_case'
# File lib/rubygems/test_case.rb, line 48 def self.searcher=(searcher) @searcher = searcher end
Returns an Array of sources to fetch remote gems from. Uses ::default_sources if the sources list is empty.
# File lib/rubygems.rb, line 973 def self.sources source_list = configuration.sources || default_sources @sources ||= Gem::SourceList.from(source_list) end
Need to be able to set the sources without calling ::sources.replace since that would cause an infinite loop.
DOC: This comment is not documentation about the method itself, it's more of a code comment about the implementation.
# File lib/rubygems.rb, line 985 def self.sources= new_sources if !new_sources @sources = nil else @sources = Gem::SourceList.from(new_sources) end end
# File lib/rubygems.rb, line 424 def self.spec_cache_dir paths.spec_cache_dir end
Glob pattern for require-able path suffixes.
# File lib/rubygems.rb, line 996 def self.suffix_pattern @suffix_pattern ||= "{#{suffixes.join(',')}}" end
Suffixes for require-able paths.
# File lib/rubygems.rb, line 1003 def self.suffixes @suffixes ||= ['', '.rb', *%w(DLEXT DLEXT2).map { |key| val = RbConfig::CONFIG[key] next unless val and not val.empty? ".#{val}" } ].compact.uniq end
Prints the amount of time the supplied block takes to run using the debug UI output.
# File lib/rubygems.rb, line 1018 def self.time(msg, width = 0, display = Gem.configuration.verbose) now = Time.now value = yield elapsed = Time.now - now ui.say "%2$*1$s: %3$3.3fs" % [-width, msg, elapsed] if display value end
Try to activate a gem containing path
. Returns true if
activation succeeded or wasn't needed because it was already activated.
Returns false if it can't find the path in a gem.
# File lib/rubygems.rb, line 200 def self.try_activate path # finds the _latest_ version... regardless of loaded specs and their deps # if another gem had a requirement that would mean we shouldn't # activate the latest version, then either it would already be activated # or if it was ambiguous (and thus unresolved) the code in our custom # require will try to activate the more specific version. spec = Gem::Specification.find_by_path path return false unless spec return true if spec.activated? begin spec.activate rescue Gem::LoadError => e # this could fail due to gem dep collisions, go lax spec_by_name = Gem::Specification.find_by_name(spec.name) if spec_by_name.nil? raise e else spec_by_name.activate end end return true end
Lazily loads DefaultUserInteraction and returns the default UI.
# File lib/rubygems.rb, line 1033 def self.ui require 'rubygems/user_interaction' Gem::DefaultUserInteraction.ui end
Looks for a gem dependency file at path
and activates the gems
in the file if found. If the file is not found an ArgumentError is raised.
If path
is not given the RUBYGEMS_GEMDEPS environment variable
is used, but if no file is found no exception is raised.
If '-' is given for path
RubyGems searches up from the
current working directory for gem dependency files (gem.deps.rb, Gemfile,
Isolate) and activates the gems in the first one found.
You can run this automatically when rubygems starts. To enable, set the
RUBYGEMS_GEMDEPS
environment variable to either the path of
your gem dependencies file or “-” to auto-discover in parent directories.
NOTE: Enabling automatic discovery on multiuser systems can lead to execution of arbitrary code when used from directories outside your control.
# File lib/rubygems.rb, line 1141 def self.use_gemdeps path = nil raise_exception = path path ||= ENV['RUBYGEMS_GEMDEPS'] return unless path path = path.dup if path == "-" then require 'rubygems/util' Gem::Util.traverse_parents Dir.pwd do |directory| dep_file = GEM_DEP_FILES.find { |f| File.file?(f) } next unless dep_file path = File.join directory, dep_file break end end path.untaint unless File.file? path then return unless raise_exception raise ArgumentError, "Unable to find gem dependencies file at #{path}" end rs = Gem::RequestSet.new @gemdeps = rs.load_gemdeps path rs.resolve_current.map do |s| sp = s.full_spec sp.activate sp end rescue Gem::LoadError, Gem::UnsatisfiableDependencyError => e warn e.message warn "You may need to `gem install -g` to install missing gems" warn "" end
Use the home
and paths
values for ::dir and ::path. Used mainly by the unit tests to
provide environment isolation.
# File lib/rubygems.rb, line 1043 def self.use_paths(home, *paths) paths.flatten! paths.compact! hash = { "GEM_HOME" => home, "GEM_PATH" => paths.empty? ? home : paths.join(File::PATH_SEPARATOR) } hash.delete_if { |_, v| v.nil? } self.paths = hash end
Path for gems in the user's home directory
# File lib/rubygems/defaults.rb, line 75 def self.user_dir parts = [Gem.user_home, '.gem', ruby_engine] parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty? File.join parts end
The home directory for the user.
# File lib/rubygems.rb, line 1054 def self.user_home @user_home ||= find_home.untaint end
Allows toggling Windows behavior. This method is available when requiring 'rubygems/test_case'
# File lib/rubygems/test_case.rb, line 56 def self.win_platform=(val) @@win_platform = val end
Is this a windows platform?
# File lib/rubygems.rb, line 1061 def self.win_platform? if @@win_platform.nil? then ruby_platform = RbConfig::CONFIG['host_os'] @@win_platform = !!WIN_PATTERNS.find { |r| ruby_platform =~ r } end @@win_platform end
Safely write a file in binary mode on all platforms.
# File lib/rubygems.rb, line 868 def self.write_binary(path, data) open(path, 'wb') do |io| begin io.flock(File::LOCK_EX) rescue *WRITE_BINARY_ERRORS end io.write data end rescue Errno::ENOLCK # NFS if Thread.main != Thread.current raise else open(path, 'wb') do |io| io.write data end end end
Private Class Methods
Finds the user's home directory.
# File lib/rubygems.rb, line 566 def self.find_home windows = File::ALT_SEPARATOR if not windows or RUBY_VERSION >= '1.9' then File.expand_path "~" else ['HOME', 'USERPROFILE'].each do |key| return File.expand_path ENV[key] if ENV[key] end if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then File.expand_path "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" end end rescue if windows then File.expand_path File.join(ENV['HOMEDRIVE'] || ENV['SystemDrive'], '/') else File.expand_path "/" end end
# File lib/rubygems.rb, line 260 def self.find_spec_for_exe name, exec_name, requirements dep = Gem::Dependency.new name, requirements loaded = Gem.loaded_specs[name] return loaded if loaded && dep.matches_spec?(loaded) specs = dep.matching_specs(true) raise Gem::GemNotFoundException, "can't find gem #{dep}" if specs.empty? specs = specs.find_all { |spec| spec.executables.include? exec_name } if exec_name unless spec = specs.first msg = "can't find gem #{name} (#{requirements}) with executable #{exec_name}" raise Gem::GemNotFoundException, msg end spec end


Form Products
My products
JotForm T-Shirt
$9.99
1
2
3
4
5
Quantity
Red
Green
Blue
Color
XS
S
M
L
XL
XXL
T-Shirt Size
JotForm Mug
$4.99
JotForm Pencil
$2.99
JotForm Sticker
$1.99
Generate Coupon
Enter Coupon
Coupon Code:
Username:
Enter
Total
submit


SimpleITK
1.1.0
SimpleITK
Code
Common
include
Classes
|
Namespaces
sitkExceptionObject.h File Reference
#include "
sitkMacro.h
"
#include "
sitkCommon.h
"
Include dependency graph for sitkExceptionObject.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Classes
class
itk::simple::GenericException
The base SimpleITK exception class.
More...
Namespaces
itk
itk::simple
Generated on Fri Mar 6 2020 16:06:38 for SimpleITK by
1.8.17


public
php_adt\Tree
|
#
__construct( mixed $data_source = null, php_adt\Arr $children = null )
Constructor.
Parameters
- $data_source
- Data associated with the node.
- $children
Returns
|
public
string
|
#
__toString( )
Stringifies the Tree instance.
Stringifies the Tree instance.
Returns
string
|
public static
|
#
traverse( php_adt\Tree $tree_node, integer $order, php_adt\Arr $accumulator )
Creates a sequence of nodes by modifying the $accumulator parameter. This is used as a helper method internally. Therefore using the 'iterable()' method is recommended.
Creates a sequence of nodes by modifying the $accumulator parameter. This is used as a helper method internally. Therefore using the 'iterable()' method is recommended.
Parameters
- $tree_node
- The root of the traversal.
- $order
- Either of the *_ORDER constants.
- $accumulator
- The sequence that holds the tree nodes in wanted order after this method has been called.
|
public
php_adt\Arr
|
#
iterable( integer $order = php_adt\Tree::PRE_ORDER )
Creates a sequence of nodes in a certain order.
Creates a sequence of nodes in a certain order.
Parameters
- $order
- Either of the *_ORDER constants.
Returns
|
public
php_adt\Arr
|
#
pre_order( )
Shortcut for calling
$this->iterable(Tree::PRE_ORDER)
Shortcut for calling
$this->iterable(Tree::PRE_ORDER)
Returns
|
public
php_adt\Arr
|
#
post_order( )
Shortcut for calling
$this->iterable(Tree::POST_ORDER)
Shortcut for calling
$this->iterable(Tree::POST_ORDER)
Returns
|
public
php_adt\Arr
|
#
level_order( )
Shortcut for calling
$this->iterable(Tree::LEVEL_ORDER)
Shortcut for calling
$this->iterable(Tree::LEVEL_ORDER)
Returns
|
public
integer
|
#
hash( )
Calculates a hash value of the tree.
Calculates a hash value of the tree.
Returns
integer
|
public
php_adt\Tree
|
#
copy( boolean $deep = false )
Creates a deep copy of the tree.
Creates a deep copy of the tree.
Parameters
- $deep
- This parameter has no effect and exists due to the interface of clonable.
Returns
|
public
boolean
|
#
equals( mixed $tree )
Indicates whether the tree is equal to another object.
Indicates whether the tree is equal to another object.
Parameters
Returns
boolean
|
public
php_adt\Set
|
#
find( callable $filter )
Searches the tree for a node that fulfills the $filter and returns a Set of those nodes.
Searches the tree for a node that fulfills the $filter and returns a Set of those nodes.
Parameters
- $filter
The filter determines which nodes are considered valid.
boolean $filter($node)
Returns
|
public
integer
|
#
depth( )
Returns the depth of the tree.
Returns the depth of the tree.
Returns
integer
|
public
integer
|
#
size( )
Returns the size of the tree. That means the number of all nodes in the tree (including the root).
Returns the size of the tree. That means the number of all nodes in the tree (including the root).
Returns
integer
|
public
integer
|
#
level( )
Returns the level of the node.
Returns the level of the node.
Returns
integer
|
public
php_adt\Tree
|
#
root( )
Returns the root of the node.
Returns the root of the node.
Returns
|
public
php_adt\Tree
|
#
parent( )
Returns the parent of the node.
Returns the parent of the node.
Returns
|
public
php_adt\Arr
|
#
children( )
Returns the children of the node.
Returns the children of the node.
Returns
|
public
php_adt\Arr
|
#
leaves( )
Returns all leaves of the tree.
Returns all leaves of the tree.
Returns
|
public
boolean
|
#
is_leaf( )
Indicates whether the node is a leaf (a leaf has no children).
Indicates whether the node is a leaf (a leaf has no children).
Returns
boolean
|
public
php_adt\Arr
|
#
siblings( )
Returns a list of all siblings with the same parent.
Returns a list of all siblings with the same parent.
Returns
|
public
php_adt\Arr
|
#
level_siblings( )
Returns a list of all nodes in the tree that have the same level.
Returns a list of all nodes in the tree that have the same level.
Returns
|
public
php_adt\Arr
|
#
descendants( )
Returns a list of all nodes in the tree (except the current node).
Returns a list of all nodes in the tree (except the current node).
Returns
|
public
php_adt\Arr
|
#
path_to_root( )
Returns a list of nodes that describes the path to the root node. The current node is not included.
Returns a list of nodes that describes the path to the root node. The current node is not included.
Returns
|
public
php_adt\Tree
|
#
set_parent( $new_parent )
Sets the parent of a node. This method should be used carefully because the parent's children are not modified. Chainable
Sets the parent of a node. This method should be used carefully because the parent's children are not modified. Chainable
Returns
|
public
php_adt\Tree
|
#
add( mixed $tree_node, integer $index = null )
Adds a node as child of the current node. Chainable
Adds a node as child of the current node. Chainable
Parameters
- $tree_node
- The new node. Also the data source for the node can be passed (it will be wrapped into a node automatically).
- $index
- The index can define at what position (among the siblings) the node will be added.
Returns
|
public
php_adt\Tree
|
#
add_multiple( php_adt\Arr $tree_nodes, integer $index = null )
Adds multiple nodes to the tree. Chainable
Adds multiple nodes to the tree. Chainable
Parameters
- $tree_nodes
- The nodes to add.
- $index
- The index can define at what position (among the siblings) the nodes will be added.
Returns
|
public
php_adt\Arr
|
#
set_children( php_adt\Arr $tree_nodes )
Sets the children of a node and returns the previous ones.
Sets the children of a node and returns the previous ones.
Parameters
- $tree_nodes
- The new children to add.
Returns
php_adt\Arr The children of the node before calling this method.
|
public
php_adt\Tree
|
#
move_to( php_adt\Tree $new_parent, integer $index = null )
Moves the node to another place in the tree. It must not be used for moving a node between different trees! Chainable
Moves the node to another place in the tree. It must not be used for moving a node between different trees! Chainable
Parameters
- $new_parent
- The new parent of the node.
- $index
- The index can define at what position (among the siblings) the node will be added.
Returns
|
public
php_adt\Tree
|
#
remove( )
Removes a node (and the entire subtree) from the tree. Chainable
Removes a node (and the entire subtree) from the tree. Chainable
Returns
|
public
php_adt\Tree
|
#
clear( )
Removes all nodes from the tree. The children's parents will be set to null. Chainable
Removes all nodes from the tree. The children's parents will be set to null. Chainable
Returns
|


East Reading College
UKPRN:12345678
Participation funding
Adult education budget:
| Baseline | £1,775,145 | |
| of which, 19+ continuing learners | -£84,161 | Value transferred to EFA for 19+ continuing learners |
| 2017 to 2018 allocation | £1,690,984 | Total of 2017 to 2018 AEB allocation |
View breakdown
Advanced learner loan
Advanced learner loan facility:
| Baseline | £494,316 | |
| 2017 to 2018 facility | £494,316 | Total value of 2017 to 2018 facility |
View breakdown
Advanced learner loan facility:
| Baseline | £75,728 | |
| 2017 to 2018 bursary | £75,728 | Total value of 2017 to 2018 bursary |


--- layout: post title: I never meant to hurt you! date: 2010-03-09 20:46:19.000000000 +01:00 categories: - linux tags: - favourite - music - personal status: publish type: post published: true meta: _edit_last: '1' author: ---
I first heard this song in my first year of college. All thanks to Monty I guess. Here are the lyrics of the song sourced from
http://lyrics.filestube.com/song/7e38a8f510a935b003e9,Porcelain.html
In my dreams I'm dying all the time
As I wake its kaleidoscopic mind
I never meant to hurt you
I never meant to lie
So this is goodbye
This is goodbye
Tell the truth you never wanted me
Tell me
In my dreams I'm jealous all the time
As I wake I'm going out of my mind
Going out of my mind
Writer : HYNDE, CHRISSIE
Copyright : Lyrics © EMI Music Publishing, Warner/Chappell Music, Inc.


Created by Chaux Cedric using reveal.js
Cascading Style Sheet
DIV
IMG A H1 H2 H3 SPAN
FORM INPUT SUBMIT BUTTON
Semantic : HEADER FOOTER ARTICLE SECTION
Firstname
Lastname
Peter
Griffin
Lois
Griffin
| Firstname | Lastname |
|---|---|
| Peter | Griffin |
| Lois | Griffin |
html body
head
/head
/body /html
selector {
property: value;
}
div {
width: 320px;
padding: 10px;
padding-left:20px;
border: 5px solid gray;
margin: 0 0 0 0 ;
}
div {
font:italic bold 12px/30px Georgia, serif;
font-color:red;
background-color: 10px;
background-image: :url("relative,or absolute");
background-repeat:repeat ;
background-position:fix;
color:pink / RGB(0.0.0);
border: 5px solid gray;
margin: 0 0 0 0 ;
display:none/inline/float/block;
z-index:-9999999-1000000
}
Relative em , rem , %
Absolute px
Your Browser developer tool is your friend
clear your browser cache ( control + f5 )
check compatibility and test
Comments your css
/*
* — Minor Section Heading —
*/
Who said it was easy
disable css aggregation in configuration>performance menu
Disable caching with development environment configuration file
clear cache in admin configuration performance
Now you can install a new themes
Or you can install a subtheme from a BaseTheme
|-core
| |-modules
| |-themes
| | |-bartik
| | |-seven
..
|-modules
|-themes
| |-contrib
| | |-zen
| | |-basic
| | |-bluemarine
| |-custom
| | |-fluffiness
|-fluffiness.breakpoints.yml
|-fluffiness.info.yml
|-fluffiness.libraries.yml
|-fluffiness.theme
|-config
| |-install
| | |-fluffiness.settings.yml
| |-schema
| | |-fluffiness.schema.yml
|-css
| |-style.css
|-images
| |-buttons.png
|-logo.svg
|-screenshot.png
The structure of files is based on SMACS & BEM
Components have their own CSS files , layout.css is separated
Base. is to harmonize default value accross browsers
layout.css is the whole page layout
Do not touch those
Modify or edit the right css file in componenets or create one
notepad , sublime, visualcode , atom , vim, geany
get emmet plugin and syntax highlighting.


Department of Advanced Science and Technology
University of Computer Studies
B.C.Sc/B.C.Tech. ( Four Year)
Computer Organization
Final Examination
Mathematics of Computing IV(CST-402)
September, 2016
Zone III
Answer ALL Questions
Time allowed 3hours.
| an = | ( | n+3 n |
) |


The Rails Internationalization API
The Ruby I18n gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or providing multi-language support in your application.
1. How I18n in Ruby on Rails works
Internationalization is a complex problem. Natural languages differ in so many ways that it is hard to provide tools for solving all problems at once. For that reason the Rails I18n API focusses on:
-
providing support for English and similar languages out of the box
-
making it easy to customize and extend everything for other languages
1.1. The overall architecture of the library
To solve this the Ruby I18n gem is split into two parts:
-
The public API which is just a Ruby module with a bunch of public methods and definitions how the library works.
-
A shipped backend (which is intentionally named the Simple backend) that implements these methods.
As a user you should always only access the public methods on the I18n module but it is useful to know about the capabilities of the backend you use and maybe exchange the shipped Simple backend with a more powerful one.
1.2. The public I18n API
We will go into more detail about the public methods later but here's a quick overview. The most important methods are:
translate # lookup translations localize # localize Date and Time objects to local formats
There are also attribute readers and writers for the following attributes:
load_path # announce your custom translation files locale # get and set the current locale default_locale # get and set the default locale exception_handler # use a different exception_handler backend # use a different backend
2. Walkthrough: setup a simple I18n'ed Rails application
There are just a few, simple steps to get up and running with a I18n support for your application.
2.1. Configure the I18n module
First of all you want to tell the I18n library where it can find your custom translation files. You might also want to set your default locale to something else than English.
You can pick whatever directory and translation file naming scheme makes sense for you. The simplest thing possible is probably to put the following into an initializer:
# in config/initializer/locale.rb # tell the I18n library where to find your translations I18n.load_path += Dir[ File.join(RAILS_ROOT, 'lib', 'locale', '*.{rb,yml}') ] # you can omit this if you're happy with English as a default locale I18n.default_locale = :"pt"
I18n.load_path is just a Ruby Array of paths to your translation files. The backend will lazy-load these translations when a translation is looked up for the first time. This makes it possible to just swap the backend with something else even after translations have already been announced.
2.2. Set the locale in each request
By default the I18n library will use the I18n.default_locale for looking up translations (if you do not specify a locale for a lookup) and this will, by default, en (English).
If you want to translate your Rails application to a single language other than English you can set I18n.default_locale to your locale. If you want to change the locale on a per-request basis though you can set it in a before_filter on the ApplicationController like this:
before_filter :set_locale def set_locale # if this is nil then I18n.default_locale will be used I18n.locale = params[:locale] end
This will already work for URLs where you pass the locale as a query parameter as in example.com?locale=pt-BR (which is what Google also does). (TODO hints about other approaches in the resources section).
Now you've initialized I18n support for your application and told it which locale should be used. With that in place you're now ready for the really interesting stuff.
2.3. Internationalize your application
The process of "internationalization" usually means to abstract all strings and other locale specific bits out of your application (TODO reference to wikipedia). The process of "localization" means to then provide translations and localized formats for these bits.
So, let's internationalize something. You most probably have something like this in one of your applications:
# config/routes.rb ActionController::Routing::Routes.draw do |map| map.root :controller => 'home', :action => 'index' end # app/controllers/home_controller.rb class HomeController < ApplicationController def index flash[:notice] = "Hello flash!" end end # app/views/home/index.html.erb
Hello world!

<%= flash[:notice] %>

TODO screenshot
Obviously there are two strings that are localized to English. In order to internationalize this code replace these strings with calls to Rails' #t helper with a key that makes sense for the translation:
# app/controllers/home_controller.rb class HomeController < ApplicationController def index flash[:notice] = t(:hello_flash) end end # app/views/home/index.html.erb
<%=t :hello_world %>

<%= flash[:notice] %>

TODO insert note about #t helper compared to I18n.t
TODO insert note/reference about structuring translation keys
When you now render this view it will show an error message that tells you that the translations for the keys :hello_world and :hello_flash are missing.
TODO screenshot
So let's add the missing translations (i.e. do the "localization" part):
# lib/locale/en.yml en-US: hello_world: Hello World hello_flash: Hello Flash # lib/locale/pirate.yml pirate: hello_world: Ahoy World hello_flash: Ahoy Flash
There you go. Your application now shows:
TODO screenshot
I18n.t 'store.title' I18n.l Time.now
3. Overview of the I18n API features
The following purposes are covered:
-
lookup translations
-
interpolate data into translations
-
pluralize translations
-
localize dates, numbers, currency etc.
3.1. Looking up translations
3.1.1. Basic lookup, scopes and nested keys
Translations are looked up by keys which can be both Symbols or Strings, so these calls are equivalent:
I18n.t :message I18n.t 'message'
translate also takes a :scope option which can contain one or many additional keys that will be used to specify a “namespace” or scope for a translation key:
I18n.t :invalid, :scope => [:active_record, :error_messages]
This looks up the :invalid message in the ActiveRecord error messages.
Additionally, both the key and scopes can be specified as dot separated keys as in:
I18n.translate :"active_record.error_messages.invalid"
Thus the following calls are equivalent:
I18n.t 'active_record.error_messages.invalid' I18n.t 'error_messages.invalid', :scope => :active_record I18n.t :invalid, :scope => 'active_record.error_messages' I18n.t :invalid, :scope => [:active_record, :error_messages]
3.1.2. Defaults
When a default option is given its value will be returned if the translation is missing:
I18n.t :missing, :default => 'Not here' # => 'Not here'
If the default value is a Symbol it will be used as a key and translated. One can provide multiple values as default. The first one that results in a value will be returned.
E.g. the following first tries to translate the key :missing and then the key :also_missing. As both do not yield a result the string ‘Not here’ will be returned:
I18n.t :missing, :default => [:also_missing, 'Not here'] # => 'Not here'
3.1.3. Bulk and namespace lookup
To lookup multiple translations at once an array of keys can be passed:
I18n.t [:odd, :even], :scope => 'active_record.error_messages' # => ["must be odd", "must be even"]
Also, a key can translate to a (potentially nested) hash as grouped translations. E.g. one can receive all ActiveRecord error messages as a Hash with:
I18n.t 'active_record.error_messages' # => { :inclusion => "is not included in the list", :exclusion => ... }
3.2. Interpolation
TODO explain what this is good for
All options besides :default and :scope that are passed to #translate will be interpolated to the translation:
I18n.backend.store_translations 'en', :thanks => 'Thanks {{name}}!' I18n.translate :thanks, :name => 'Jeremy' # => 'Thanks Jeremy!'
If a translation uses :default or :scope as a interpolation variable an I18n::ReservedInterpolationKey exception is raised. If a translation expects an interpolation variable but it has not been passed to #translate an I18n::MissingInterpolationArgument exception is raised.
3.3. Pluralization
TODO explain what this is good for
The :count interpolation variable has a special role in that it both is interpolated to the translation and used to pick a pluralization from the translations according to the pluralization rules defined by CLDR:
I18n.backend.store_translations 'en-US', :inbox => { # TODO change this :one => '1 message', :other => '{{count}} messages' } I18n.translate :inbox, :count => 2 # => '2 messages'
The algorithm for pluralizations in en-US is as simple as:
entry[count == 1 ? 0 : 1]
I.e. the translation denoted as :one is regarded as singular, the other is used as plural (including the count being zero).
If the lookup for the key does not return an Hash suitable for pluralization an I18n::InvalidPluralizationData exception is raised.
3.4. Setting and passing a locale
The locale can be either set pseudo-globally to I18n.locale (which uses Thread.current like, e.g., Time.zone) or can be passed as an option to #translate and #localize.
If no locale is passed I18n.locale is used:
I18n.locale = :'de' I18n.t :foo I18n.l Time.now
Explicitely passing a locale:
I18n.t :foo, :locale => :'de' I18n.l Time.now, :locale => :'de'
I18n.locale defaults to I18n.default_locale which defaults to :en. The default locale can be set like this:
I18n.default_locale = :'de'
4. How to store your custom translations
The shipped Simple backend allows you to store translations in both plain Ruby and YAML format. (2)
For example a Ruby Hash providing translations can look like this:
{ :'pt-BR' => { :foo => { :bar => "baz" } } }
The equivalent YAML file would look like this:
"pt-BR": foo: bar: baz
As you see in both cases the toplevel key is the locale. :foo is a namespace key and :bar is the key for the translation "baz".
Here is a "real" example from the ActiveSupport en-US translations YAML file:
"en": date: formats: default: "%Y-%m-%d" short: "%b %d" long: "%B %d, %Y"
So, all of the following equivalent lookups will return the :short date format "%B %d":
I18n.t 'date.formats.short' I18n.t 'formats.short', :scope => :date I18n.t :short, :scope => 'date.formats' I18n.t :short, :scope => [:date, :formats]
4.1. Translations for ActiveRecord models
You can use the methods Model.human_name and Model.human_attribute_name(attribute) to transparently lookup translations for your model and attribute names.
For example when you add the following translations:
en: activerecord: models: user: Dude attributes: user: login: "Handle" # will translate User attribute "login" as "Handle"
Then User.human_name will return "Dude" and User.human_attribute_name(:login) will return "Handle".
4.1.1. Error message scopes
ActiveRecord validation error messages can also be translated easily. ActiveRecord gives you a couple of namespaces where you can place your message translations in order to provide different messages and translation for certain models, attributes and/or validations. It also transparently takes single table inheritance into account.

Consider a User model with a validates_presence_of validation for the name attribute like this:
class User < ActiveRecord::Base validates_presence_of :name end
The key for the error message in this case is :blank. So ActiveRecord will first try to look up an error message with:
activerecord.errors.messages.models.user.attributes.name.blank
If it's not there it will try:
activerecord.errors.messages.models.user.blank
If this is also not there it will use the default message from:
activerecord.errors.messages.blank
When your models are additionally using inheritance then the messages are looked up for the inherited model class names are looked up.
For example, you might have an Admin model inheriting from User:
class Admin < User validates_presence_of :name end
Then ActiveRecord will look for messages in this order:
activerecord.errors.models.admin.attributes.title.blank activerecord.errors.models.admin.blank activerecord.errors.models.user.attributes.title.blank activerecord.errors.models.user.blank activerecord.errors.messages.blank
This way you can provide special translations for various error messages at different points in your models inheritance chain and in the attributes, models or default scopes.
4.1.2. Error message interpolation
The translated model name and translated attribute name are always available for interpolation.
Count and/or value are available where applicable. Count can be used for pluralization if present:
| validation | with option | message | interpolation |
| validates_confirmation_of | - | :confirmation | - |
| validates_acceptance_of | - | :accepted | - |
| validates_presence_of | - | :blank | - |
| validates_length_of | :within, :in | :too_short | count |
| validates_length_of | :within, :in | :too_long | count |
| validates_length_of | :is | :wrong_length | count |
| validates_length_of | :minimum | :too_short | count |
| validates_length_of | :maximum | :too_long | count |
| validates_uniqueness_of | - | :taken | value |
| validates_format_of | - | :invalid | value |
| validates_inclusion_of | - | :inclusion | value |
| validates_exclusion_of | - | :exclusion | value |
| validates_associated | - | :invalid | value |
| validates_numericality_of | - | :not_a_number | value |
| validates_numericality_of | :odd | :odd | value |
| validates_numericality_of | :even | :even | value |
4.1.3. Translations for the ActiveRecord error_messages_for helper
If you are using the ActiveRecord error_messages_for helper you will want to add translations for it.
Rails ships with the following translations:
"en": activerecord: errors: template: header: one: "1 error prohibited this {{model}} from being saved" other: "{{count}} errors prohibited this {{model}} from being saved" body: "There were problems with the following fields:"
4.2. Other translations and localizations
Rails uses fixed strings and other localizations, such as format strings and other format information in a couple of helpers.
TODO list helpers and available keys
5. Customize your I18n setup
5.1. Using different backends
For several reasons the shipped Simple backend only does the "simplest thing that ever could work" for Ruby on Rails (1) … which means that it is only guaranteed to work for English and, as a side effect, languages that are very similar to English. Also, the simple backend is only capable of reading translations but can not dynamically store them to any format.
That does not mean you're stuck with these limitations though. The Ruby I18n gem makes it very easy to exchange the Simple backend implementation with something else that fits better for your needs. E.g. you could exchange it with Globalize's Static backend:
I18n.backend = Globalize::Backend::Static.new
TODO expand this …? list some backends and their features?
5.2. Using different exception handlers
TODO
-
Explain what exceptions are raised and why we are using exceptions for communication from backend to frontend.
-
Explain the default behaviour.
-
Explain the :raise option
-
Example 1: the Rails #t helper uses a custom exception handler that catches I18n::MissingTranslationData and wraps the message into a span with the CSS class "translation_missing"
-
Example 2: for tests you might want a handler that just raises all exceptions all the time
-
Example 3: a handler
6. Resources
7. Footnotes
(1) One of these reasons is that we don't want to any unnecessary load for applications that do not need any I18n capabilities, so we need to keep the I18n library as simple as possible for English. Another reason is that it is virtually impossible to implement a one-fits-all solution for all problems related to I18n for all existing languages.  This also makes it much easier to experiment with custom features and extensions.
(2) Other backends might allow or require to use other formats, e.g. a GetText backend might allow to read GetText files.
8. Credits
9. NOTES
How to contribute?


This manual is intended for reference by developers modifying the CMake source tree itself.
CMake is required to build with ancient C++ compilers and standard library implementations. Some common C++ constructs may not be used in CMake in order to build with such toolchains.
The at() member function of std::vector may not be used. Use operator[] instead:
std::vector<int> someVec = getVec();
int i1 = someVec.at(5); // Wrong
int i2 = someVec[5]; // Ok
The append() and clear() member functions of std::string may not be used. Use operator+= and operator= instead:
std::string stringBuilder;
stringBuilder.append("chunk"); // Wrong
stringBuilder.clear(); // Wrong
stringBuilder += "chunk"; // Ok
stringBuilder = ""; // Ok
The find() member function of a const std::set instance may not be used in a comparison with the iterator returned by end():
const std::set<cmStdString>& someSet = getSet();
if (someSet.find("needle") == someSet.end()) // Wrong
{
// ...
}
The return value of find() must be assigned to an intermediate const_iterator for comparison:
const std::set<cmStdString>& someSet;
const std::set<cmStdString>::const_iterator i = someSet.find("needle");
if (i != propSet.end()) // Ok
{
// ...
}
In some implementations, algorithms operating on iterators to a container of std::string can not accept a const char* value:
const char* dir = /*...*/;
std::vector<std::string> vec;
// ...
std::binary_search(vec.begin(), vec.end(), dir); // Wrong
The std::string may need to be explicitly constructed:
const char* dir = /*...*/;
std::vector<std::string> vec;
// ...
std::binary_search(vec.begin(), vec.end(), std::string(dir)); // Ok
Some implementations have a std::auto_ptr which can not be used as a return value from a function. std::auto_ptr may not be used. Use cmsys::auto_ptr instead.
Use of std::vector::insert with an iterator whose element_type requires conversion is not allowed:
std::set<cmStdString> theSet;
std::vector<std::string> theVector;
theVector.insert(theVector.end(), theSet.begin(), theSet.end()); // Wrong
A loop must be used instead:
std::set<cmStdString> theSet;
std::vector<std::string> theVector;
for(std::set<cmStdString>::iterator li = theSet.begin();
li != theSet.end(); ++li)
{
theVector.push_back(*li);
}
Use of std::set::insert is not allowed with any source container:
std::set<cmTarget*> theSet;
theSet.insert(targets.begin(), targets.end()); // Wrong
A loop must be used instead:
ConstIterator it = targets.begin();
const ConstIterator end = targets.end();
for ( ; it != end; ++it)
{
theSet.insert(*it);
}
On ancient compilers, C++ template must use template parameters in function arguments. If no parameter of that type is needed, the common workaround is to add a defaulted pointer to the type to the templated function. However, this does not work with other ancient compilers:
template<typename PropertyType>
PropertyType getTypedProperty(cmTarget* tgt, const char* prop,
PropertyType* = 0) // Wrong
{
}
template<typename PropertyType>
PropertyType getTypedProperty(cmTarget* tgt, const char* prop,
PropertyType*) // Ok
{
}
and invoke it with the value 0 explicitly in all cases.
min and max are defined as macros on some systems. std::min and std::max may not be used. Use cmMinimum and cmMaximum instead.
The Help directory contains CMake help manual source files. They are written using the reStructuredText markup syntax and processed by Sphinx to generate the CMake help manuals.
In addition to using Sphinx to generate the CMake help manuals, we also use a C++-implemented document processor to print documents for the --help-* command-line help options. It supports a subset of reStructuredText markup. When authoring or modifying documents, please verify that the command-line help looks good in addition to the Sphinx-generated html and man pages.
The command-line help processor supports the following constructs defined by reStructuredText, Sphinx, and a CMake extension to Sphinx.
Inline markup constructs not listed above are printed literally in the command-line help output. We prefer to use inline markup constructs that look correct in source form, so avoid use of \-escapes in favor of inline literals when possible.
Explicit markup blocks not matching directives listed above are removed from command-line help output. Do not use them, except for plain .. comments that are removed by Sphinx too.
Note that nested indentation of blocks is not recognized by the command-line help processor. Therefore:
Try to avoid these cases in practice.
CMake adds a Sphinx Domain called cmake, also called the “CMake Domain”. It defines several “object” types for CMake documentation:
Documentation objects in the CMake Domain come from two sources. First, the CMake extension to Sphinx transforms every document named with the form Help/<type>/<file-name>.rst to a domain object with type <type>. The object name is extracted from the document title, which is expected to be of the form:
<object-name>
-------------
and to appear at or near the top of the .rst file before any other lines starting in a letter, digit, or <. If no such title appears literally in the .rst file, the object name is the <file-name>. If a title does appear, it is expected that <file-name> is equal to <object-name> with any < and > characters removed.
Second, the CMake Domain provides directives to define objects inside other documents:
.. command:: <command-name>
This indented block documents <command-name>.
.. variable:: <variable-name>
This indented block documents <variable-name>.
Object types for which no directive is available must be defined using the first approach above.
Sphinx uses reStructuredText interpreted text roles to provide cross-reference syntax. The CMake Domain provides for each domain object type a role of the same name to cross-reference it. CMake Domain roles are inline markup of the forms:
:type:`name`
:type:`text <name>`
where type is the domain object type and name is the domain object name. In the first form the link text will be name (or name() if the type is command) and in the second form the link text will be the explicit text. For example, the code:
* The :command:`list` command.
* The :command:`list(APPEND)` sub-command.
* The :command:`list() command <list>`.
* The :command:`list(APPEND) sub-command <list>`.
* The :variable:`CMAKE_VERSION` variable.
* The :prop_tgt:`OUTPUT_NAME_<CONFIG>` target property.
produces:
Note that CMake Domain roles differ from Sphinx and reStructuredText convention in that the form a, without a space preceding <, is interpreted as a name instead of link text with an explicit target. This is necessary because we use <placeholders> frequently in object names like OUTPUT_NAME_<CONFIG>. The form a , with a space preceding <, is still interpreted as a link text with an explicit target.
Command signatures should be marked up as plain literal blocks, not as cmake code-blocks.
Signatures are separated from preceding content by a horizontal line. That is, use:
... preceding paragraph.
---------------------------------------------------------------------
::
add_library(<lib> ...)
This signature is used for ...
Use “OFF” and “ON” for boolean values which can be modified by the user, such as POSITION_INDEPENDENT_CODE. Such properties may be “enabled” and “disabled”. Use “True” and “False” for inherent values which can’t be modified after being set, such as the IMPORTED property of a build target.
Use two spaces for indentation. Use two spaces between sentences in prose.
Prefer to mark the start of literal blocks with :: at the end of the preceding paragraph. In cases where the following block gets a code-block marker, put a single : at the end of the preceding paragraph.
Prefer to restrict the width of lines to 75-80 columns. This is not a hard restriction, but writing new paragraphs wrapped at 75 columns allows space for adding minor content without significant re-wrapping of content.
Mark up self-references with inline-literal syntax. For example, within the add_executable command documentation, use
``add_executable``
not
:command:`add_executable`
which is used elsewhere.
Mark up all other linkable references as links, including repeats. An alternative, which is used by wikipedia (http://en.wikipedia.org/wiki/WP:REPEATLINK), is to link to a reference only once per article. That style is not used in CMake documentation.
Mark up references to keywords in signatures, file names, and other technical terms with inline-literl syntax, for example:
If ``WIN32`` is used with :command:`add_executable`, the
:prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
creates the file ``<name>.exe`` on Windows.
If referring to a concept which corresponds to a property, and that concept is described in a high-level manual, prefer to link to the manual section instead of the property. For example:
This command creates an :ref:`Imported Target <Imported Targets>`.
instead of:
This command creates an :prop_tgt:`IMPORTED` target.
The latter should be used only when referring specifically to the property.
References to manual sections are not automatically created by creating a section, but code such as:
.. _`Imported Targets`:
creates a suitable anchor. Use an anchor name which matches the name of the corresponding section. Refer to the anchor using a cross-reference with specified text.
Imported Targets need the IMPORTED term marked up with care in particular because the term may refer to a command keyword (IMPORTED), a target property (IMPORTED), or a concept (Imported Targets).
Where a property, command or variable is related conceptually to others, by for example, being related to the buildsystem description, generator expressions or Qt, each relevant property, command or variable should link to the primary manual, which provides high-level information. Only particular information relating to the command should be in the documentation of the command.
When marking section titles, make the section decoration line as long as the title text. Use only a line below the title, not above. For example:
Title Text
----------
Capitalize the first letter of each non-minor word in the title.
When referring to properties, variables, commands etc, prefer to link to the target object and follow that with the type of object it is. For example:
Set the :prop_tgt:`AUTOMOC` target property to ``ON``.
Instead of
Set the target property :prop_tgt:`AUTOMOC` to ``ON``.
The policy directive is an exception, and the type us usually referred to before the link:
If policy :prop_tgt:`CMP0022` is set to ``NEW`` the behavior is ...
Signatures of commands should wrap optional parts with square brackets, and should mark list of optional arguments with an ellipsis (...). Elements of the signature which are specified by the user should be specified with angle brackets, and may be referred to in prose using inline-literal syntax.
Use American English spellings in prose.
The Modules directory contains CMake-language .cmake module files.
To document CMake module Modules/<module-name>.cmake, modify Help/manual/cmake-modules.7.rst to reference the module in the toctree directive, in sorted order, as:
/module/<module-name>
Then add the module document file Help/module/<module-name>.rst containing just the line:
.. cmake-module:: ../../Modules/<module-name>.cmake
The cmake-module directive will scan the module file to extract reStructuredText markup from comment blocks that start in .rst:. Add to the top of Modules/<module-name>.cmake a Line Comment block of the form:
#.rst:
# <module-name>
# -------------
#
# <reStructuredText documentation of module>
or a Bracket Comment of the form:
#[[.rst:
<module-name>
-------------
<reStructuredText documentation of module>
#]]
Any number of = may be used in the opening and closing brackets as long as they match. Content on the line containing the closing bracket is excluded if and only if the line starts in #.
Additional such .rst: comments may appear anywhere in the module file. All such comments must start with # in the first column.
For example, a Modules/Findxxx.cmake module may contain:
#.rst:
# FindXxx
# -------
#
# This is a cool module.
# This module does really cool stuff.
# It can do even more than you think.
#
# It even needs two paragraphs to tell you about it.
# And it defines the following variables:
#
# * VAR_COOL: this is great isn't it?
# * VAR_REALLY_COOL: cool right?

#[========================================[.rst:
.. command:: xxx_do_something
This command does something for Xxx::
xxx_do_something(some arguments)
#]========================================]
macro(xxx_do_something)

endmacro()
A “find module” is a Modules/Find<package>.cmake file to be loaded by the find_package() command when invoked for <package>.
We would like all FindXxx.cmake files to produce consistent variable names. Please use the following consistent variable names for general use.
You do not have to provide all of the above variables. You should provide Xxx_FOUND under most circumstances. If Xxx is a library, then Xxx_LIBRARIES, should also be defined, and Xxx_INCLUDE_DIRS should usually be defined (I guess libm.a might be an exception)
The following names should not usually be used in CMakeLists.txt files, but they may be usefully modified in users’ CMake Caches to control stuff.
For tidiness’s sake, try to keep as many options as possible out of the cache, leaving at least one option which can be used to disable use of the module, or locate a not-found library (e.g. Xxx_ROOT_DIR). For the same reason, mark most cache options as advanced.
If you need other commands to do special things then it should still begin with Xxx_. This gives a sort of namespace effect and keeps things tidy for the user. You should put comments describing all the exported settings, plus descriptions of any the users can use to control stuff.
You really should also provide backwards compatibility any old settings that were actually in use. Make sure you comment them as deprecated, so that no-one starts using them.
To add a module to the CMake documentation, follow the steps in the Module Documentation section above. Test the documentation formatting by running cmake --help-module FindXxx, and also by enabling the SPHINX_HTML and SPHINX_MAN options to build the documentation. Edit the comments until generated documentation looks satisfactory. To have a .cmake file in this directory NOT show up in the modules documentation, simply leave out the Help/module/<module-name>.rst file and the Help/manual/cmake-modules.7.rst toctree entry.
After the documentation, leave a BLANK line, and then add a copyright and licence notice block like this one:
#=============================================================================
# Copyright 2009-2011 Your Name
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
The layout of the notice block is strictly enforced by the ModuleNotices test. Only the year range and name may be changed freely.
A FindXxx.cmake module will typically be loaded by the command:
FIND_PACKAGE(Xxx [major[.minor[.patch[.tweak]]]] [EXACT]
[QUIET] [[REQUIRED|COMPONENTS] [components...]])
If any version numbers are given to the command it will set the following variables before loading the module:
If the find module supports versioning it should locate a version of the package that is compatible with the version requested. If a compatible version of the package cannot be found the module should not report success. The version of the package found should be stored in “Xxx_VERSION...” version variables documented by the module.
If the QUIET option is given to the command it will set the variable Xxx_FIND_QUIETLY to true before loading the FindXxx.cmake module. If this variable is set the module should not complain about not being able to find the package. If the REQUIRED option is given to the command it will set the variable Xxx_FIND_REQUIRED to true before loading the FindXxx.cmake module. If this variable is set the module should issue a FATAL_ERROR if the package cannot be found. If neither the QUIET nor REQUIRED options are given then the FindXxx.cmake module should look for the package and complain without error if the module is not found.
FIND_PACKAGE() will set the variable CMAKE_FIND_PACKAGE_NAME to contain the actual name of the package.
A package can provide sub-components. Those components can be listed after the COMPONENTS (or REQUIRED) or OPTIONAL_COMPONENTS keywords. The set of all listed components will be specified in a Xxx_FIND_COMPONENTS variable. For each package-specific component, say Yyy, a variable Xxx_FIND_REQUIRED_Yyy will be set to true if it listed after COMPONENTS and it will be set to false if it was listed after OPTIONAL_COMPONENTS. Using those variables a FindXxx.cmake module and also a XxxConfig.cmake package configuration file can determine whether and which components have been requested, and whether they were requested as required or as optional. For each of the requested components a Xxx_Yyy_FOUND variable should be set accordingly. The per-package Xxx_FOUND variable should be only set to true if all requested required components have been found. A missing optional component should not keep the Xxx_FOUND variable from being set to true. If the package provides Xxx_INCLUDE_DIRS and Xxx_LIBRARIES variables, the include dirs and libraries for all components which were requested and which have been found should be added to those two variables.
To get this behavior you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS() macro, as an example see FindJPEG.cmake.
For internal implementation, it’s a generally accepted convention that variables starting with underscore are for temporary use only. (variable starting with an underscore are not intended as a reserved prefix).


Computer Programming | Design | Software Development | Content Creator | Computer Networking | Freelancer
I'm passionate about software development with a keen interest in Android, Website development and software engineering in general. I'm passionate about developer communities with keen interest in empowering. ALso, am a writer and blogger.
i'm a graduate student from Karatina University,
School of Pure and Applied Science, Department of Computer Science and Informatics
studied Information Technology with good skill in:
• Computer Programming,
• Designs,
• Software Development, and
• Computer Networking.
I received a second Class Honour in Information Technology specializing in Networking.
Through my four years at Karatina University, apart from academics, I
was involved in various activities including give-back community programs and Karatina IT Club.
Through my four years in high school, I was involve in coming up with the Law Club in our school which was responsible for updating and informing other student of the legal procedures of our land and their rights as humans.
•Implementing of the computer systems.
• Repairing and maintaining of ICT equipment and associated peripherals.
• Monitoring performance of ICT systems and equipment.
• Data manipulating and analysis.
• Updating the server daily.
• Opening and closing the BR system daily.
Engaged in:
• essay writing,
• Academic writing services,
• blogging and
• content writing services.


Observed and calculated SXRPD patterns of Ca 0.89TaN 2 (λ = 0.4133 Å) in space group C2/ m. Vertical ticks denote the Bragg positions. Inset: Zoom of the (1̅13) and (202) doublet of C2/ m SG, a single reflection (015) would be present in this region for R3̅ m SG.


Want to notify them of changes
Don't really care about the others (if they even exist)
We have iPhone and Android apps
Apple has APNS
(and APNS_SANDBOX)
So how do we notify the users?
Phones have to ask for local tokens
These tokens identify the device to the push service
User logs in to the app,
so we know who they are
Background task sends the token to the server
(connection is authenticated to the user)
Celery for asynchronous task execution
SNS talks to both APNS and GCM
Webserver adds async task to register phone enpoint with SNS
SNS gives us a different token
Store this token against the user
Some action by a user needs to be pushed out
Let's say
"Game cancelled"
Ideally this should make the phones go BING
View POST initiates async task
Celery worker picks up the task
Queries DB to find affected users
Get all SNS tokens for those users
Issues: there are many, perhaps I should have given a real talk


Provides peruvian agricultural production data from the Agriculture Minestry of Peru (MINAGRI). The first version includes 6 crops: rice, quinoa, potato, sweet potato, tomato and wheat; all of them across 24 departments. Initially, in excel files which has been transformed and assembled using tidy data principles, i.e. each variable is in a column, each observation is a row and each value is in a cell. The variables variables are sowing and harvest area per crop, yield, production and price per plot, every one year, from 2004 to 2014.
| Version: | 1.0.0 |
| Depends: | R (≥ 3.3.1) |
| Published: | 2017-03-02 |
| Author: | Omar Benites-Alfaro [aut, cre], Pablo Gutierrez-Vilchez [aut], Jossyn Lockuan-Cotrina [aut], Giorgio Cruz-Fajardo [aut], Grace Guevara-Diaz [aut], Charlie Mendez-Morales [aut], Liliana Aragon-Caballero [ctb], Raul Blas-Sevillano [ctb], Agronomy Faculty, National Agrarian University La Molina (UNALM) [cph] (Copyright holder of all R code), Agriculture Ministry of Peru (MINAGRI) [cph] (Data source come from MINAGRI) |
| Maintainer: | Omar Benites-Alfaro <obacc07 at gmail.com> |
| BugReports: | https://github.com/omarbenites/cropdatape/issues |
| License: | MIT + file LICENSE |
| URL: | https://github.com/omarbenites/cropdatape, http://siea.minagri.gob.pe/siea/?q=publicaciones/anuarios-estadisticos |
| NeedsCompilation: | no |
| Materials: | README |
| CRAN checks: | cropdatape results |
| Reference manual: | cropdatape.pdf |
| Package source: | cropdatape_1.0.0.tar.gz |
| Windows binaries: | r-devel: cropdatape_1.0.0.zip, r-release: cropdatape_1.0.0.zip, r-oldrel: cropdatape_1.0.0.zip |
| OS X binaries: | r-release: cropdatape_1.0.0.tgz, r-oldrel: cropdatape_1.0.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=cropdatape to link to this page.


{% extends 'base.html' %} {% block title %}{{ super() }} > Your profile{% endblock %} {% block below_menubar %}
Well done! Your account has been updated!


{% extends "aristotle_mdr/static/about_item_base.html" %} {% block title %}About: Registration Authority{% endblock %} {% block item_name %}Registration Authority{% endblock %} {% block breadcrumbs %}
An autonomous body that operates and manages a Metadata Registry based upon the ISO/IEC 11179 Metadata Registry standard, for the purpose of registering metadata items. A Registration Authority should encourage consistent processes within the metadata registry, through the development and disemination of formal guidelines and procedures. A Registration Authority should also faciliate the process of metadata item registration within its domain of responsibility by receiving and processing submissions from suitable Submitting Organisations.
{% endblock %}


{include file='include/head'}
Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.
Learn More


LETTERS TO THE EDITOR: Spencer made own bed
by THE WASHINGTON TIMESANALYSIS/OPINION:
U.S. Navy Secretary Richard Spencer chose poorly when he decided to argue with the commander in chief about Navy SEAL Eddie Gallagher. He chose to punish a decorated warfighter for taking a picture that thousands of in-theater vets and news photographers have taken in every war; and he chose to cross swords with the president and the secretary of Defense.
Given his political correctness, Mr. Spencer has now witnessed the future.  The coup to bring down the U.S. government has been stopped, but fortunately not before the discovery of all of the co-conspirators who will need to be punished.
It’s a simple rule, really; you don’t argue with the commander in chief, period. You may volunteer to retire or you may choose walk into the ocean, but you never, ever argue with No.1 If you do, you forfeit your career. Mr. Gallagher was acquitted and Mr. Spencer was left with a single photo. That’s all. The obvious answer was to simply take away some rank and then move on. But no — Mr. Spencer had to be the toughest guy in town. Well, he was wrong and things turned out fine for the United States. We have our warfighter back and now there is a loathsome political lemming that has brought shame to himself simply by making a poor choice and hooking his horse to the wagon of James Comey, John Brennan and James Clapper.
JEFFREY H. DISSELL
Gainesville, Fla.
Sign up for Daily Opinion Newsletter
Copyright © 2019 The Washington Times, LLC. Click here for reprint permission.
Please read our comment policy before commenting.


Version 2 is a significant upgrade in terms of ease-of-use and power compared to version 1. In brief, the difference is that
Upgrading via NuGet should be automatic. The upgrade script will delete two files from your ConfigZilla folder, "ConfigZillaCreateXslt.targets" and "ConfigZilla.Tasks.dll". Neither of these are needed anymore. References to them will also be removed from ConfigZilla.csproj, which may cause a warning about needing to reload the project file.
There are no changes to any of your .targets and .xslt files in your Transforms folder, except that the "czp" automatic Xsl Parameters are no longer gathered. If you were using these, please convert to using MSBuild properties instead.
You can now create a Transforms folder in each project being compiled; the contents of these will be included after the ConfigZilla\Transforms folder, thus giving the ability to override the values set in ConfigZilla\Transforms. Most users will not need this feature and will be able to keep all their transformations centralised in ConfigZilla\Transforms.
The XmlDeserializeConfigSectionHandler class now supports validation using System.ComponentModel.DataAnnotations attributes and the DefaultValue attribute. n.b. If upgrading from version 1.*, the copy of XmlDeserializeConfigSectionHandler in your ConfigZilla project will NOT be upgraded in case you have made your own customisations to it. To workaround this, create a ConsoleApp, install ConfigZilla into it, and then just copy-and-paste the class into your existing project.


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF KERALA AT ERNAKULAM PRESENT THE HONOURABLE MR. JUSTICE ALEXANDER THOMAS TUESDAY, THE 10TH DAY OF MARCH 2020 / 20TH PHALGUNA, 1941 WP(C).No.7167 OF 2020(U) PETITIONER/S: SATHEESAN S AGED 55 YEARS SON OF SADANANDAN,ABHIN BHAVANAM, KALLELIBHAGOM.P.O, KARUNAGAPPALLY-690519. BY ADVS. SRI.P.B.SAHASRANAMAN SRI.T.S.HARIKUMAR RESPONDENT/S: 1 KERALA STATE POLLUTION CONTROL BOARD REPRESENTED BY ITS MEMBER SECRETARY, PATTOM.P.O, THIRUVANANTHAPURAM-695004. 2 THE ENVIRONMENTAL ENGINEER, KERALA STATE POLLUTION CONTROL BOARD,DISTRICT OFFICE,USHUS BUILDING,BIG BAZAAR,KOLLAM-691001. 3 V.N.DEVARAJAN, VALIYAPARAMBIL,GRAMAM,ENNAKKADU.P.O,CHENGANNUR,ALAPUZ HA-689624.  No. 7167 of 2020 ----------------------------------------- Dated this the 10th day of March, 2020 JUDGMENT
The case set up in the W.P.(c.) is as follows :
Ext.P1 is the copy of the consent issued by the 2 nd respondent for the Establishment of petroleum outlet. Having found that the seepage from the petrol tanks has an adverse effect on nearby groundwater and wells, the National Green Tribunal appointed a Committee. Based on the Committee report, the Central Pollution Control Board issued guidelines stipulating a safe distance of 50 meters for the establishment of petrol pumps. Ext.P2 is the copy of circular issued by the 1 st respondent, Kerala State Pollution Control Board with regard to the same. The petitioner is residing within 50 meters from the said site. The petitioner made a representation pointing out the above and requested the respondents 1 and 2 not to issue consent to operate the same, in these circumstances. Hasty steps are being taken to issue consent to operate without considering Exhibit.P2 circular and Exhibit.P3.
2. It is in the light of these averments and ontentions that the petitioner has filed the instant W.P.(C.) with the following prayers:
i. "To issue a writ, direction or order in the nature of mandamus or such other appropriate writ, direction or order commanding the respondents 1 and 2 WP(C).No.7167 OF 2020(U) 3 not to issue consent to operate as contemplate by the Water (Prevention and Control of Pollution) Act, 1974 and Air (Prevention and Control of Pollution) Act, 1981 to the petroleum outlet to which consent to establish was granted as per Exhibit.P.1;
ii. ii. To issue a writ, direction or order in the nature of mandamus directing the 1st respondent to consider Exhibit.P.4 representation within a reasonable time and till such time no consent to establish to be granted to the 3 rd respondent for the operation of petroleum outlet to which consent to establish was granted as per Exhibit P.1;
iii. iii. Such other relief's which this Hon'ble Court deems fit and necessary in the circumstances of the case and the costs of this case."
3. Heard Sri. P.B.Sahasranaman, learned counsel appearing for the petitioner, Sri.T.Naveen, learned standing counsel appearing for the Kerala State Pollution control Board, respondent Nos. 1 and 2. In the nature of the orders proposed to be passed in this petition, the notice to respondent No.3 will stand disposed with.
4. Taking note of the facts and circumstances of this case, it is ordered that the 2nd respondent-Environment Engineer of the Kerala State Pollution control Board will take the matters raised in Ext.P4 representation/complaint for consideration, without much delay, after affording reasonable opportunity of being heard to the petitioner and 3 rd respondent, will pass appropriate orders thereon, in accordance with the law, without much delay, within a period of one month from the date of production of a certified copy of this judgment.
5. It is made clear that in case the application submitted by the 3 rd respondent for the statutory consent to operate the petroleum outlet is pending consideration before the 2nd respondent, the 2nd respondent may ensure that an appropriate inspection may be conducted with due prior WP(C).No.7167 OF 2020(U) 4 notice to the 3rd respondent and thereafter, may ensure that copy of the inspection report is given to the petitioner and the 3 rd respondent and appropriate decision may be taken in accordance with the law, by the 2 nd respondent on both the matters raised by the 3 rd respondent in this application for securing consent to operate the unit as well as the objections raised by the petitioner in Ext.P4 complaint, after granting reasonable opportunity of being heard to both sides as stated hereinabove.
6. The Registry will forward a copy of this judgment to the 3 rd respondent for necessary information, at the cost of the petitioner.
With these observations and directions, the above W.P.(C.) will stand disposed of.
Sd/-
ALEXANDER THOMAS, JUDGE SKS WP(C).No.7167 OF 2020(U) 5 APPENDIX PETITIONER'S/S EXHIBITS:
EXHIBIT P1 TRUE PHOTOCOPY OF THE CONSENT TO ESTABLISH ISSUED BY THE 2ND RESPONDENT TO THE 3RD RESPONDENT,DATED 24.5.2019.
EXHIBIT P2 TRUE PHOTOCOPY OF THE CIRCULAR NO.PCB/HO/HOW/RULES 9/7/2019 ISSUED BY THE 1ST RESPONDENT,DATED 24.02.2020. EXHIBIT P3 TRUE PHOTOSTAT COPY OF THE REPRESENTATION MADE BY THIS PETITIONER,DATED 15.02.2020 THE 1ST RESPONDENT. EXHIBIT P4 TRUE PHOTOSTAT COPY OF THE REPRESENTATION MADE BY THIS PETITIONER TO THE 2ND RESPONDENT,DATED 15.02.2020.


Posted:
Sun Jun 11, 2006 9:26 pm
by Joe M.
looks good.
This will be awesome!
Posted:
Tue Jun 27, 2006 5:38 pm
by Joe M.
so is anything happening, or have we stalled out? (I certainly have--orientation, tkd worlds, job, etc...)
Posted:
Wed Jun 28, 2006 6:22 pm
by Karl G.
I have "stalled'...job, packing, etc. are making me very busy.