vagrant-unbundled 2.0.3.0 → 2.0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -10
- data/Gemfile.lock +16 -2
- data/README.md +1 -0
- data/bin/vagrant +1 -1
- data/lib/vagrant/action/builtin/handle_box.rb +1 -1
- data/lib/vagrant/action/general/package.rb +1 -1
- data/lib/vagrant/action.rb +3 -1
- data/lib/vagrant/alias.rb +56 -0
- data/lib/vagrant/bundler.rb +1 -1
- data/lib/vagrant/capability_host.rb +1 -1
- data/lib/vagrant/cli.rb +8 -0
- data/lib/vagrant/config/version_base.rb +1 -1
- data/lib/vagrant/environment.rb +7 -1
- data/lib/vagrant/errors.rb +4 -0
- data/lib/vagrant/host.rb +1 -1
- data/lib/vagrant/machine.rb +1 -1
- data/lib/vagrant/machine_index.rb +1 -1
- data/lib/vagrant/plugin/v1/guest.rb +1 -1
- data/lib/vagrant/plugin/v1/host.rb +1 -1
- data/lib/vagrant/plugin/v1/plugin.rb +1 -1
- data/lib/vagrant/plugin/v1/provider.rb +1 -1
- data/lib/vagrant/plugin/v2/guest.rb +1 -1
- data/lib/vagrant/plugin/v2/host.rb +1 -1
- data/lib/vagrant/plugin/v2/plugin.rb +1 -1
- data/lib/vagrant/plugin/v2/provider.rb +1 -1
- data/lib/vagrant/shared_helpers.rb +30 -9
- data/lib/vagrant/util/checkpoint_client.rb +8 -0
- data/lib/vagrant/util/downloader.rb +1 -1
- data/lib/vagrant/util/platform.rb +11 -3
- data/lib/vagrant/util/powershell.rb +17 -1
- data/lib/vagrant/util/safe_exec.rb +1 -1
- data/lib/vagrant/util/ssh.rb +4 -1
- data/lib/vagrant/util/stacked_proc_runner.rb +1 -1
- data/lib/vagrant/util/template_renderer.rb +2 -2
- data/lib/vagrant/vagrantfile.rb +1 -1
- data/lib/vagrant.rb +8 -0
- data/plugins/commands/plugin/gem_helper.rb +1 -1
- data/plugins/commands/powershell/command.rb +2 -2
- data/plugins/commands/powershell/scripts/enable_psremoting.ps1 +1 -1
- data/plugins/communicators/ssh/communicator.rb +10 -1
- data/plugins/communicators/winrm/command_filters/mkdir.rb +4 -2
- data/plugins/communicators/winrm/command_filters/rm.rb +5 -3
- data/plugins/communicators/winrm/command_filters/test.rb +3 -1
- data/plugins/communicators/winrm/command_filters/which.rb +4 -2
- data/plugins/communicators/winrm/communicator.rb +3 -3
- data/plugins/guests/amazon/cap/flavor.rb +1 -1
- data/plugins/guests/coreos/cap/configure_networks.rb +1 -1
- data/plugins/guests/coreos/guest.rb +1 -1
- data/plugins/guests/debian/cap/configure_networks.rb +1 -1
- data/plugins/guests/freebsd/cap/configure_networks.rb +1 -1
- data/plugins/guests/photon/guest.rb +1 -1
- data/plugins/guests/windows/cap/change_host_name.rb +6 -1
- data/plugins/guests/windows/cap/mount_shared_folder.rb +1 -1
- data/plugins/hosts/alt/plugin.rb +1 -1
- data/plugins/hosts/arch/plugin.rb +1 -1
- data/plugins/hosts/gentoo/plugin.rb +1 -1
- data/plugins/hosts/linux/plugin.rb +1 -1
- data/plugins/hosts/redhat/plugin.rb +1 -1
- data/plugins/hosts/slackware/plugin.rb +2 -2
- data/plugins/kernel_v2/config/push.rb +1 -1
- data/plugins/kernel_v2/config/vm.rb +1 -1
- data/plugins/providers/docker/action/compare_synced_folders.rb +1 -1
- data/plugins/providers/virtualbox/action/network.rb +9 -5
- data/plugins/providers/virtualbox/action/network_fix_ipv6.rb +1 -1
- data/plugins/provisioners/chef/config/chef_zero.rb +1 -1
- data/plugins/provisioners/chef/provisioner/chef_solo.rb +2 -2
- data/plugins/provisioners/chef/provisioner/chef_zero.rb +3 -3
- data/plugins/provisioners/puppet/config/puppet.rb +2 -0
- data/plugins/provisioners/puppet/provisioner/puppet.rb +18 -1
- data/plugins/provisioners/salt/config.rb +6 -0
- data/plugins/provisioners/salt/provisioner.rb +11 -1
- data/templates/locales/command_ps.yml +1 -1
- data/templates/locales/en.yml +13 -4
- data/templates/locales/guest_windows.yml +1 -1
- data/templates/locales/providers_docker.yml +1 -1
- data/templates/locales/synced_folder_smb.yml +2 -2
- data/vagrant.gemspec +2 -0
- data/vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-f3daedaac493/vagrant-spec.gemspec +1 -1
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/.document +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/.gitignore +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/.travis.yml +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/CHANGELOG.md +209 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/Gemfile +4 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/LICENSE.txt +78 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/README.md +67 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/Rakefile +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/data/public_suffix_list.dat +12440 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/domain_name.gemspec +36 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/etld_data.rb +8474 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/etld_data.rb.erb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/punycode.rb +283 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name/version.rb +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/lib/domain_name.rb +297 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/test/helper.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/test/test_domain_name-punycode.rb +97 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/test/test_domain_name.rb +317 -0
- data/vendor/bundle/ruby/2.5.0/gems/domain_name-0.5.20180417/tool/gen_etld_data.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/CHANGES +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/LICENSE +201 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/MANIFEST +9 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/README +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/Rakefile +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/ffi-win32-extensions.gemspec +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/lib/ffi/win32/extensions.rb +96 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/lib/ffi-win32-extensions.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/test/test_ffi_extensions.rb +41 -0
- data/vendor/bundle/ruby/2.5.0/gems/ffi-win32-extensions-1.0.3/test/test_string_extensions.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/CHANGES +235 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/MANIFEST +16 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/README +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/Rakefile +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/appveyor.yml +50 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file/constants.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file/functions.rb +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file/structs.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32/file.rb +585 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/lib/win32-file.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_link.rb +141 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_misc.rb +16 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_path.rb +282 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/test/test_win32_file_stat.rb +330 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-0.8.1/win32-file.gemspec +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/CHANGES +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/MANIFEST +18 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/README +47 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/Rakefile +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/appveyor.yml +53 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security/constants.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security/functions.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security/structs.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32/file/security.rb +963 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/lib/win32-file-security.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_acls.rb +34 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_constants.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_encryption.rb +90 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_ffi.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_ownership.rb +174 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_permissions.rb +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_version.rb +14 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/win32-file-security.gemspec +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/CHANGES +169 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/MANIFEST +12 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/README +94 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/Rakefile +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/appveyor.yml +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/certs/djberg96_pub.pem +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/stat.rb +1008 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/windows/constants.rb +94 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/windows/functions.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32/file/windows/structs.rb +196 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/lib/win32-file-stat.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/test/test_file_stat.rb +677 -0
- data/vendor/bundle/ruby/2.5.0/gems/win32-file-stat-1.5.5/win32-file-stat.gemspec +30 -0
- data/vendor/bundle/ruby/2.5.0/specifications/domain_name-0.5.20180417.gemspec +46 -0
- data/vendor/bundle/ruby/2.5.0/specifications/ffi-win32-extensions-1.0.3.gemspec +38 -0
- data/vendor/bundle/ruby/2.5.0/specifications/win32-file-0.8.1.gemspec +51 -0
- data/vendor/bundle/ruby/2.5.0/specifications/win32-file-security-1.0.10.gemspec +47 -0
- data/vendor/bundle/ruby/2.5.0/specifications/win32-file-stat-1.5.5.gemspec +48 -0
- data/version.txt +1 -1
- metadata +114 -2
@@ -89,7 +89,7 @@ module VagrantPlugins
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def need_configure
|
92
|
-
@config.minion_config or @config.minion_key or @config.master_config or @config.master_key or @config.grains_config or @config.version
|
92
|
+
@config.minion_config or @config.minion_key or @config.master_config or @config.master_key or @config.grains_config or @config.version or @config.minion_json_config or @config.master_json_config
|
93
93
|
end
|
94
94
|
|
95
95
|
def need_install
|
@@ -117,6 +117,16 @@ module VagrantPlugins
|
|
117
117
|
options = "%s %s" % [options, @config.bootstrap_options]
|
118
118
|
end
|
119
119
|
|
120
|
+
if @config.master_json_config && @machine.config.vm.communicator != :winrm
|
121
|
+
config = @config.master_json_config
|
122
|
+
options = "%s -J '#{config}'" % [options]
|
123
|
+
end
|
124
|
+
|
125
|
+
if @config.minion_json_config && @machine.config.vm.communicator != :winrm
|
126
|
+
config = @config.minion_json_config
|
127
|
+
options = "%s -j '#{config}'" % [options]
|
128
|
+
end
|
129
|
+
|
120
130
|
if configure && @machine.config.vm.communicator != :winrm
|
121
131
|
options = "%s -F -c %s" % [options, config_dir]
|
122
132
|
end
|
data/templates/locales/en.yml
CHANGED
@@ -402,6 +402,12 @@ en:
|
|
402
402
|
Machine name: %{name}
|
403
403
|
Active provider: %{active_provider}
|
404
404
|
Requested provider: %{requested_provider}
|
405
|
+
alias_invalid_error: |-
|
406
|
+
The defined alias is not valid. Please review the information below
|
407
|
+
to help resolve the issue:
|
408
|
+
|
409
|
+
Alias: %{alias}
|
410
|
+
Message: %{message}
|
405
411
|
batch_multi_error: |-
|
406
412
|
An error occurred while executing multiple actions in parallel.
|
407
413
|
Any errors that occurred are shown below.
|
@@ -775,7 +781,7 @@ en:
|
|
775
781
|
checksum!
|
776
782
|
|
777
783
|
File source: %{source}
|
778
|
-
|
784
|
+
Checksum type: %{type}
|
779
785
|
Expected checksum: %{expected_checksum}
|
780
786
|
Calculated checksum: %{actual_checksum}
|
781
787
|
env_inval: |-
|
@@ -928,7 +934,7 @@ en:
|
|
928
934
|
Vagrant was instructed to configure the %{device} network device to
|
929
935
|
be managed by NetworkManager. However, the configured guest VM does
|
930
936
|
not have NetworkManager installed. To fix this error please remove
|
931
|
-
the `nm_controlled` setting from local
|
937
|
+
the `nm_controlled` setting from local Vagrantfile. If NetworkManager
|
932
938
|
is required to manage the network devices, please use a box with
|
933
939
|
NetworkManager installed.
|
934
940
|
nfs_bad_exports: |-
|
@@ -1625,7 +1631,7 @@ en:
|
|
1625
1631
|
Vagrant is unable to use the VirtualBox provider from the Windows Subsystem for
|
1626
1632
|
Linux without access to the Windows environment. Enabling this access must be
|
1627
1633
|
done with caution and an understanding of the implications. For more information
|
1628
|
-
on
|
1634
|
+
on enabling Windows access and using VirtualBox from the Windows Subsystem for
|
1629
1635
|
Linux, please refer to the Vagrant documentation:
|
1630
1636
|
|
1631
1637
|
https://www.vagrantup.com/docs/other/wsl.html
|
@@ -1838,7 +1844,7 @@ en:
|
|
1838
1844
|
have to destroy and restart the virtual machine.
|
1839
1845
|
gurumeditation: |-
|
1840
1846
|
The VM is in the "guru meditation" state. This is a rare case which means
|
1841
|
-
that an internal error in
|
1847
|
+
that an internal error in VirtualBox caused the VM to fail. This is always
|
1842
1848
|
the sign of a bug in VirtualBox. You can try to bring your VM back online
|
1843
1849
|
with a `vagrant up`.
|
1844
1850
|
inaccessible: |-
|
@@ -2070,6 +2076,9 @@ en:
|
|
2070
2076
|
This will cause your specified IP to be inaccessible. Please change
|
2071
2077
|
the IP or name of your host only network so that it no longer matches that of
|
2072
2078
|
a bridged or non-hostonly network.
|
2079
|
+
|
2080
|
+
Bridged Network Address: '%{netaddr}'
|
2081
|
+
Host-only Network '%{interface_name}': '%{that_netaddr}'
|
2073
2082
|
creating: "Creating new host only network for environment..."
|
2074
2083
|
enabling: "Enabling host only network..."
|
2075
2084
|
not_found: |-
|
@@ -19,5 +19,5 @@ en:
|
|
19
19
|
specified a FQDN instead of just a host name.
|
20
20
|
|
21
21
|
Ensure the new guest name is properly formatted. Standard names may
|
22
|
-
contain letters (a-z, A-Z), numbers (0-9), and
|
22
|
+
contain letters (a-z, A-Z), numbers (0-9), and hyphens (-), but no
|
23
23
|
spaces or periods (.). The name may not consist entirely of digits.
|
@@ -118,7 +118,7 @@ en:
|
|
118
118
|
|
119
119
|
errors:
|
120
120
|
compose_lock_timeout: |-
|
121
|
-
Vagrant
|
121
|
+
Vagrant encountered a timeout waiting for the docker compose driver
|
122
122
|
to become available. Please try to run your command again. If you
|
123
123
|
continue to experience this error it may be resolved by disabling
|
124
124
|
parallel execution.
|
@@ -20,10 +20,10 @@ en:
|
|
20
20
|
|
21
21
|
uac:
|
22
22
|
prune_warning: |-
|
23
|
-
Vagrant requires
|
23
|
+
Vagrant requires administrator access for pruning SMB shares and
|
24
24
|
may request access to complete removal of stale shares.
|
25
25
|
create_warning: |-
|
26
|
-
Vagrant requires
|
26
|
+
Vagrant requires administrator access to create SMB shares and
|
27
27
|
may request access to complete setup of configured shares.
|
28
28
|
errors:
|
29
29
|
start_failed: |-
|
data/vagrant.gemspec
CHANGED
@@ -27,6 +27,8 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_dependency "rb-kqueue", "~> 0.2.0"
|
28
28
|
s.add_dependency "rest-client", "~> 2.0"
|
29
29
|
s.add_dependency "wdm", "~> 0.1.0"
|
30
|
+
s.add_dependency "win32-file", "~> 0.8.1"
|
31
|
+
s.add_dependency "win32-file-security", "~> 1.0.10"
|
30
32
|
s.add_dependency "winrm", "~> 2.1"
|
31
33
|
s.add_dependency "winrm-fs", "~> 1.0"
|
32
34
|
s.add_dependency "winrm-elevated", "~> 1.1"
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Mitchell Hashimoto".freeze]
|
11
|
-
s.date = "2018-03
|
11
|
+
s.date = "2018-05-03"
|
12
12
|
s.description = "Tool and library for testing Vagrant plugins".freeze
|
13
13
|
s.email = ["mitchell.hashimoto@gmail.com".freeze]
|
14
14
|
s.executables = ["vagrant-spec".freeze]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.8.7
|
4
|
+
- ree
|
5
|
+
- 1.9.3
|
6
|
+
- 2.0.0
|
7
|
+
- 2.1.9
|
8
|
+
- 2.2.5
|
9
|
+
- 2.3.1
|
10
|
+
- ruby-head
|
11
|
+
- jruby-1.7.20
|
12
|
+
- jruby-9.0.5.0
|
13
|
+
- jruby-head
|
14
|
+
- rbx-2
|
15
|
+
matrix:
|
16
|
+
allow_failures:
|
17
|
+
- rvm: ruby-head
|
18
|
+
- rvm: jruby-head
|
19
|
+
- rvm: rbx-2
|
20
|
+
before_install:
|
21
|
+
- gem update bundler
|
@@ -0,0 +1,209 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [v0.5.20170404](https://github.com/knu/ruby-domain_name/tree/v0.5.20170404) (2017-04-04)
|
4
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20170223...v0.5.20170404)
|
5
|
+
|
6
|
+
- Update the eTLD database to 2017-04-04T20:20:25Z
|
7
|
+
|
8
|
+
## [v0.5.20170223](https://github.com/knu/ruby-domain_name/tree/v0.5.20170223) (2017-02-23)
|
9
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20161129...v0.5.20170223)
|
10
|
+
|
11
|
+
- Update the eTLD database to 2017-02-23T00:52:11Z
|
12
|
+
|
13
|
+
## [v0.5.20161129](https://github.com/knu/ruby-domain_name/tree/v0.5.20161129) (2016-11-29)
|
14
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160826...v0.5.20161129)
|
15
|
+
|
16
|
+
- Update the eTLD database to 2016-11-29T01:22:03Z
|
17
|
+
|
18
|
+
## [v0.5.20161021](https://github.com/knu/ruby-domain_name/tree/v0.5.20161021) (2016-10-27)
|
19
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160826...v0.5.20161021)
|
20
|
+
|
21
|
+
- Update the eTLD database to 2016-10-21T20:52:10Z
|
22
|
+
|
23
|
+
## [v0.5.20160826](https://github.com/knu/ruby-domain_name/tree/v0.5.20160826) (2016-09-01)
|
24
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160615...v0.5.20160826)
|
25
|
+
|
26
|
+
- Update the license for the eTLD database
|
27
|
+
- Update the eTLD database to 2016-08-26T16:52:03Z
|
28
|
+
|
29
|
+
## [v0.5.20160615](https://github.com/knu/ruby-domain_name/tree/v0.5.20160615) (2016-06-16)
|
30
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160310...v0.5.20160615)
|
31
|
+
|
32
|
+
- Always set `@domain` to avoid a warning when `$VERBOSE` is on
|
33
|
+
- Update the eTLD database to 2016-06-15T16:22:11Z
|
34
|
+
|
35
|
+
## [v0.5.20160310](https://github.com/knu/ruby-domain_name/tree/v0.5.20160310) (2016-03-17)
|
36
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160309...v0.5.20160310)
|
37
|
+
|
38
|
+
- Update development dependencies for obsolete rubies
|
39
|
+
- Update the eTLD database to 2016-03-10T21:22:02Z
|
40
|
+
|
41
|
+
## [v0.5.20160309](https://github.com/knu/ruby-domain_name/tree/v0.5.20160309) (2016-03-09)
|
42
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160216...v0.5.20160309)
|
43
|
+
|
44
|
+
- Fix support for Ruby 1.8
|
45
|
+
- Update the eTLD database to 2016-03-09T09:52:02Z
|
46
|
+
|
47
|
+
## [v0.5.20160216](https://github.com/knu/ruby-domain_name/tree/v0.5.20160216) (2016-02-24)
|
48
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20160128...v0.5.20160216)
|
49
|
+
|
50
|
+
- Update the eTLD database to 2016-02-16T19:22:02Z
|
51
|
+
|
52
|
+
## [v0.5.20160128](https://github.com/knu/ruby-domain_name/tree/v0.5.20160128) (2016-01-29)
|
53
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.25...v0.5.20160128)
|
54
|
+
|
55
|
+
- Use the date as part of VERSION
|
56
|
+
- Update the eTLD database to 2016-01-28T23:22:02Z
|
57
|
+
|
58
|
+
## [v0.5.25](https://github.com/knu/ruby-domain_name/tree/v0.5.25) (2015-10-06)
|
59
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.24...v0.5.25)
|
60
|
+
|
61
|
+
- Restrict i18n < 0.7.0 on ruby 1.8.
|
62
|
+
- Update the eTLD database to 2015-09-29T17:22:03Z
|
63
|
+
|
64
|
+
## [v0.5.24](https://github.com/knu/ruby-domain_name/tree/v0.5.24) (2015-04-16)
|
65
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.23...v0.5.24)
|
66
|
+
|
67
|
+
- Update the eTLD database to 2015-04-07T20:26:05Z
|
68
|
+
|
69
|
+
## [v0.5.23](https://github.com/knu/ruby-domain_name/tree/v0.5.23) (2014-12-19)
|
70
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.22...v0.5.23)
|
71
|
+
|
72
|
+
- Update the eTLD database to 2014-12-18T02:26:03Z
|
73
|
+
|
74
|
+
## [v0.5.22](https://github.com/knu/ruby-domain_name/tree/v0.5.22) (2014-10-28)
|
75
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.21...v0.5.22)
|
76
|
+
|
77
|
+
- Update the eTLD database to 2014-10-27T15:26:07Z
|
78
|
+
|
79
|
+
## [v0.5.21](https://github.com/knu/ruby-domain_name/tree/v0.5.21) (2014-09-09)
|
80
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.20...v0.5.21)
|
81
|
+
|
82
|
+
- Update the eTLD database to 2014-09-05T01:56:10Z
|
83
|
+
|
84
|
+
## [v0.5.20](https://github.com/knu/ruby-domain_name/tree/v0.5.20) (2014-08-18)
|
85
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.19...v0.5.20)
|
86
|
+
|
87
|
+
- Update the eTLD database to 2014-08-14T00:56:09Z
|
88
|
+
|
89
|
+
## [v0.5.19](https://github.com/knu/ruby-domain_name/tree/v0.5.19) (2014-06-12)
|
90
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.18...v0.5.19)
|
91
|
+
|
92
|
+
- Update the eTLD database to 2014-06-11T15:26:13Z
|
93
|
+
|
94
|
+
## [v0.5.18](https://github.com/knu/ruby-domain_name/tree/v0.5.18) (2014-03-27)
|
95
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.17...v0.5.18)
|
96
|
+
|
97
|
+
- Update the eTLD database to 2014-03-27T03:00:59Z
|
98
|
+
|
99
|
+
## [v0.5.17](https://github.com/knu/ruby-domain_name/tree/v0.5.17) (2014-03-21)
|
100
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.16...v0.5.17)
|
101
|
+
|
102
|
+
- Update the eTLD database to 2014-03-20T15:01:09Z
|
103
|
+
|
104
|
+
## [v0.5.16](https://github.com/knu/ruby-domain_name/tree/v0.5.16) (2014-02-12)
|
105
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.15...v0.5.16)
|
106
|
+
|
107
|
+
- Update the eTLD database to 2014-02-11T16:01:07Z
|
108
|
+
|
109
|
+
## [v0.5.15](https://github.com/knu/ruby-domain_name/tree/v0.5.15) (2013-11-15)
|
110
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.14...v0.5.15)
|
111
|
+
|
112
|
+
- Update the eTLD database to 2013-11-15T16:01:28Z
|
113
|
+
- Merge IDN tests from mozilla-central/netwerk/test/unit/data/test_psl.txt
|
114
|
+
|
115
|
+
## [v0.5.14](https://github.com/knu/ruby-domain_name/tree/v0.5.14) (2013-10-16)
|
116
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.13...v0.5.14)
|
117
|
+
|
118
|
+
- Update the eTLD database to 2013-10-16T07:01:24Z
|
119
|
+
|
120
|
+
## [v0.5.13](https://github.com/knu/ruby-domain_name/tree/v0.5.13) (2013-08-18)
|
121
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.12...v0.5.13)
|
122
|
+
|
123
|
+
- Update the eTLD database to 2013-08-15T11:01:26Z
|
124
|
+
- Adjust dependencies for Ruby 1.8
|
125
|
+
|
126
|
+
## [v0.5.12](https://github.com/knu/ruby-domain_name/tree/v0.5.12) (2013-06-07)
|
127
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.11...v0.5.12)
|
128
|
+
|
129
|
+
- Update the eTLD database to 2013-06-06T23:00:56Z
|
130
|
+
- Add *_idn methods that do ToUnicode conversion
|
131
|
+
|
132
|
+
## [v0.5.11](https://github.com/knu/ruby-domain_name/tree/v0.5.11) (2013-04-12)
|
133
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.10...v0.5.11)
|
134
|
+
|
135
|
+
- Add DomainName#superdomain
|
136
|
+
- Update the database to 2013-04-05T23:00:49Z
|
137
|
+
|
138
|
+
## [v0.5.10](https://github.com/knu/ruby-domain_name/tree/v0.5.10) (2013-04-01)
|
139
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.9...v0.5.10)
|
140
|
+
|
141
|
+
- Update the eTLD database to that of 2013-03-31T03:02:39Z
|
142
|
+
|
143
|
+
## [v0.5.9](https://github.com/knu/ruby-domain_name/tree/v0.5.9) (2013-03-17)
|
144
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.8...v0.5.9)
|
145
|
+
|
146
|
+
- Support unf 0.1.0
|
147
|
+
|
148
|
+
## [v0.5.8](https://github.com/knu/ruby-domain_name/tree/v0.5.8) (2013-03-14)
|
149
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.7...v0.5.8)
|
150
|
+
|
151
|
+
- Update the eTLD database to the version as of 2013-02-18T20:02:07Z
|
152
|
+
|
153
|
+
## [v0.5.7](https://github.com/knu/ruby-domain_name/tree/v0.5.7) (2013-01-07)
|
154
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.6...v0.5.7)
|
155
|
+
|
156
|
+
- Update the eTLD list
|
157
|
+
|
158
|
+
## [v0.5.6](https://github.com/knu/ruby-domain_name/tree/v0.5.6) (2012-12-06)
|
159
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.5...v0.5.6)
|
160
|
+
|
161
|
+
- Update the eTLD list
|
162
|
+
|
163
|
+
## [v0.5.5](https://github.com/knu/ruby-domain_name/tree/v0.5.5) (2012-12-06)
|
164
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.4...v0.5.5)
|
165
|
+
|
166
|
+
- Add an optional host_only flag to DomainName#cookie_domain?
|
167
|
+
- Migrate from jeweler to bundle gem
|
168
|
+
|
169
|
+
## [v0.5.4](https://github.com/knu/ruby-domain_name/tree/v0.5.4) (2012-09-18)
|
170
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.3...v0.5.4)
|
171
|
+
|
172
|
+
- Update the eTLD list
|
173
|
+
- Import updated test cases suggested by Mozilla developers
|
174
|
+
|
175
|
+
## [v0.5.3](https://github.com/knu/ruby-domain_name/tree/v0.5.3) (2012-04-06)
|
176
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.2...v0.5.3)
|
177
|
+
|
178
|
+
- Implement Punycode decoder
|
179
|
+
|
180
|
+
**Closed issues:**
|
181
|
+
|
182
|
+
- Running DomainName multi-threaded leads to Stack Errors [\#2](https://github.com/knu/ruby-domain_name/issues/2)
|
183
|
+
|
184
|
+
## [v0.5.2](https://github.com/knu/ruby-domain_name/tree/v0.5.2) (2012-01-18)
|
185
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.1...v0.5.2)
|
186
|
+
|
187
|
+
- Update the eTLD list
|
188
|
+
|
189
|
+
## [v0.5.1](https://github.com/knu/ruby-domain_name/tree/v0.5.1) (2011-11-09)
|
190
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.5.0...v0.5.1)
|
191
|
+
|
192
|
+
- DomainName.new calls #to_str if a non-string object is given
|
193
|
+
- Fix support for IPv6 addresses enclosed in square brackets
|
194
|
+
|
195
|
+
**Merged pull requests:**
|
196
|
+
|
197
|
+
- Fixed DomainName\#\<=\> for use with Ruby 1.8.7 [\#1](https://github.com/knu/ruby-domain_name/pull/1) ([drbrain](https://github.com/drbrain))
|
198
|
+
|
199
|
+
## [v0.5.0](https://github.com/knu/ruby-domain_name/tree/v0.5.0) (2011-11-04)
|
200
|
+
[Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.0.0...v0.5.0)
|
201
|
+
|
202
|
+
- Implement DomainName comparison and fix cookie_domain?()
|
203
|
+
- Avoid warnings about uninitialized instance variables
|
204
|
+
|
205
|
+
## [v0.0.0](https://github.com/knu/ruby-domain_name/tree/v0.0.0) (2011-10-29)
|
206
|
+
|
207
|
+
- Initial release
|
208
|
+
|
209
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
@@ -0,0 +1,78 @@
|
|
1
|
+
Copyright (c) 2011-2017 Akinori MUSHA
|
2
|
+
|
3
|
+
All rights reserved.
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions
|
7
|
+
are met:
|
8
|
+
1. Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
notice, this list of conditions and the following disclaimer in the
|
12
|
+
documentation and/or other materials provided with the distribution.
|
13
|
+
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
15
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
16
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
17
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
18
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
19
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
20
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
21
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
22
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
23
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
24
|
+
SUCH DAMAGE.
|
25
|
+
|
26
|
+
* lib/domain_name/punycode.rb
|
27
|
+
|
28
|
+
This file is derived from the implementation of punycode available at
|
29
|
+
here:
|
30
|
+
|
31
|
+
https://www.verisign.com/en_US/channel-resources/domain-registry-products/idn-sdks/index.xhtml
|
32
|
+
|
33
|
+
Copyright (C) 2000-2002 Verisign Inc., All rights reserved.
|
34
|
+
|
35
|
+
Redistribution and use in source and binary forms, with or
|
36
|
+
without modification, are permitted provided that the following
|
37
|
+
conditions are met:
|
38
|
+
|
39
|
+
1) Redistributions of source code must retain the above copyright
|
40
|
+
notice, this list of conditions and the following disclaimer.
|
41
|
+
|
42
|
+
2) Redistributions in binary form must reproduce the above copyright
|
43
|
+
notice, this list of conditions and the following disclaimer in
|
44
|
+
the documentation and/or other materials provided with the
|
45
|
+
distribution.
|
46
|
+
|
47
|
+
3) Neither the name of the VeriSign Inc. nor the names of its
|
48
|
+
contributors may be used to endorse or promote products derived
|
49
|
+
from this software without specific prior written permission.
|
50
|
+
|
51
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
52
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
53
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
54
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
55
|
+
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
56
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
57
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
58
|
+
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
59
|
+
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
60
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
61
|
+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
62
|
+
POSSIBILITY OF SUCH DAMAGE.
|
63
|
+
|
64
|
+
This software is licensed under the BSD open source license. For more
|
65
|
+
information visit www.opensource.org.
|
66
|
+
|
67
|
+
Authors:
|
68
|
+
John Colosi (VeriSign)
|
69
|
+
Srikanth Veeramachaneni (VeriSign)
|
70
|
+
Nagesh Chigurupati (Verisign)
|
71
|
+
Praveen Srinivasan(Verisign)
|
72
|
+
|
73
|
+
* lib/domain_name/etld_data.rb
|
74
|
+
|
75
|
+
This file is generated from the Public Suffix List
|
76
|
+
(https://publicsuffix.org/), which is licensed under MPL 2.0:
|
77
|
+
|
78
|
+
https://mozilla.org/MPL/2.0/
|
@@ -0,0 +1,67 @@
|
|
1
|
+
domain_name
|
2
|
+
===========
|
3
|
+
|
4
|
+
Synopsis
|
5
|
+
--------
|
6
|
+
|
7
|
+
Domain Name manipulation library for Ruby
|
8
|
+
|
9
|
+
Description
|
10
|
+
-----------
|
11
|
+
|
12
|
+
* Parses a domain name ready for extracting the registered domain and
|
13
|
+
TLD.
|
14
|
+
|
15
|
+
require "domain_name"
|
16
|
+
|
17
|
+
host = DomainName("a.b.example.co.uk")
|
18
|
+
host.domain #=> "example.co.uk"
|
19
|
+
host.tld #=> "uk"
|
20
|
+
host.cookie_domain?("example.co.uk") #=> true
|
21
|
+
host.cookie_domain?("co.uk") #=> false
|
22
|
+
|
23
|
+
host = DomainName("[::1]") # IP addresses like "192.168.1.1" and "::1" are also acceptable
|
24
|
+
host.ipaddr? #=> true
|
25
|
+
host.cookie_domain?("0:0:0:0:0:0:0:1") #=> true
|
26
|
+
|
27
|
+
* Implements rudimental IDNA support.
|
28
|
+
|
29
|
+
To-do's
|
30
|
+
-------
|
31
|
+
|
32
|
+
* Implement IDNA 2008 (and/or 2003) including the domain label
|
33
|
+
validation and mapping defined in RFC 5891-5895 and UTS #46.
|
34
|
+
(work in progress)
|
35
|
+
|
36
|
+
* Define a compact YAML serialization format.
|
37
|
+
|
38
|
+
Installation
|
39
|
+
------------
|
40
|
+
|
41
|
+
gem install domain_name
|
42
|
+
|
43
|
+
References
|
44
|
+
----------
|
45
|
+
|
46
|
+
* [RFC 3492](http://tools.ietf.org/html/rfc3492) (Obsolete; just for test cases)
|
47
|
+
|
48
|
+
* [RFC 5890](http://tools.ietf.org/html/rfc5890)
|
49
|
+
|
50
|
+
* [RFC 5891](http://tools.ietf.org/html/rfc5891)
|
51
|
+
|
52
|
+
* [RFC 5892](http://tools.ietf.org/html/rfc5892)
|
53
|
+
|
54
|
+
* [RFC 5893](http://tools.ietf.org/html/rfc5892)
|
55
|
+
|
56
|
+
* [Public Suffix List](https://publicsuffix.org/list/)
|
57
|
+
|
58
|
+
License
|
59
|
+
-------
|
60
|
+
|
61
|
+
Copyright (c) 2011-2017 Akinori MUSHA
|
62
|
+
|
63
|
+
Licensed under the 2-clause BSD license.
|
64
|
+
|
65
|
+
Some portion of this library is copyrighted by third parties and
|
66
|
+
licensed under MPL 2.0 or 3-clause BSD license,
|
67
|
+
See `LICENSE.txt` for details.
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'uri'
|
3
|
+
ETLD_DATA_URI = URI('https://publicsuffix.org/list/public_suffix_list.dat')
|
4
|
+
ETLD_DATA_FILE = 'data/public_suffix_list.dat'
|
5
|
+
ETLD_DATA_RB = 'lib/domain_name/etld_data.rb'
|
6
|
+
VERSION_RB = 'lib/domain_name/version.rb'
|
7
|
+
|
8
|
+
task :default => :test
|
9
|
+
|
10
|
+
task :test => ETLD_DATA_RB
|
11
|
+
|
12
|
+
task :import => :etld_data
|
13
|
+
|
14
|
+
#
|
15
|
+
# eTLD Database
|
16
|
+
#
|
17
|
+
|
18
|
+
task :etld_data do
|
19
|
+
require 'open-uri'
|
20
|
+
require 'time'
|
21
|
+
|
22
|
+
begin
|
23
|
+
begin
|
24
|
+
load File.join('.', ETLD_DATA_RB)
|
25
|
+
data = ETLD_DATA_URI.read(
|
26
|
+
'If-Modified-Since' => Time.parse(DomainName::ETLD_DATA_DATE).rfc2822
|
27
|
+
)
|
28
|
+
rescue LoadError, NameError
|
29
|
+
data = ETLD_DATA_URI.read
|
30
|
+
end
|
31
|
+
puts 'eTLD database is modified.'
|
32
|
+
date = data.last_modified
|
33
|
+
File.write(ETLD_DATA_FILE, data)
|
34
|
+
File.utime Time.now, date, ETLD_DATA_FILE
|
35
|
+
if new_version = DomainName::VERSION.dup.sub!(/\b\d{8}\b/, date.strftime('%Y%m%d'))
|
36
|
+
File.open(VERSION_RB, 'r+') { |rb|
|
37
|
+
content = rb.read
|
38
|
+
rb.rewind
|
39
|
+
rb.write(content.sub(/(?<=^ VERSION = ')#{Regexp.quote(DomainName::VERSION)}(?='$)/, new_version))
|
40
|
+
rb.truncate(rb.tell)
|
41
|
+
}
|
42
|
+
end
|
43
|
+
Rake::Task[ETLD_DATA_RB].execute
|
44
|
+
rescue OpenURI::HTTPError => e
|
45
|
+
if e.io.status.first == '304' # Not Modified
|
46
|
+
puts 'eTLD database is up-to-date.'
|
47
|
+
else
|
48
|
+
raise
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
namespace :etld_data do
|
54
|
+
task :commit do
|
55
|
+
load ETLD_DATA_RB
|
56
|
+
|
57
|
+
sh 'git', 'commit',
|
58
|
+
ETLD_DATA_FILE,
|
59
|
+
ETLD_DATA_RB,
|
60
|
+
VERSION_RB,
|
61
|
+
'-m', 'Update the eTLD database to %s.' % DomainName::ETLD_DATA_DATE
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
file ETLD_DATA_RB => [
|
66
|
+
ETLD_DATA_FILE,
|
67
|
+
ETLD_DATA_RB + '.erb',
|
68
|
+
'tool/gen_etld_data.rb'
|
69
|
+
] do
|
70
|
+
ruby 'tool/gen_etld_data.rb'
|
71
|
+
end
|
72
|
+
|
73
|
+
require 'rake/testtask'
|
74
|
+
Rake::TestTask.new(:test) do |test|
|
75
|
+
test.libs << 'test'
|
76
|
+
test.pattern = 'test/**/test_*.rb'
|
77
|
+
test.verbose = true
|
78
|
+
end
|
79
|
+
|
80
|
+
require 'rdoc/task'
|
81
|
+
Rake::RDocTask.new do |rdoc|
|
82
|
+
version = DomainName::VERSION
|
83
|
+
|
84
|
+
rdoc.rdoc_dir = 'rdoc'
|
85
|
+
rdoc.title = "domain_name #{version}"
|
86
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
87
|
+
rdoc.rdoc_files.include(Bundler::GemHelper.gemspec.extra_rdoc_files)
|
88
|
+
end
|