gem_hadar 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5fe560e5107888fde1dd49366cf0a6a500cff06
4
- data.tar.gz: 234199f9ea6b11a501495bd9844449feafaaa7b5
3
+ metadata.gz: e914a529db15e5d1d41af6541617ade9bac66443
4
+ data.tar.gz: a11d516f9a51aaf2f087c8ec81c54b281baedf7d
5
5
  SHA512:
6
- metadata.gz: de88d72c1feb8d04aa61dc0893752bee89ecf8c1b3acd21156bede99d61173f2e61d314aeffafeb4146d51a25be021b0bfbc24feb7abefad6dc346a0c44fec2c
7
- data.tar.gz: 9dede73f4bf2f500e5eb581ffc4743665579b6248489e4dc720da68a53fe2e936844077650de331139880a0dd7c2526eb3fa7d31d1ed520205025d7fc87f5111
6
+ metadata.gz: 3edf7891a10ada6de2f1c30c330be0fec154c44eb5b3ee948b60a587118ca373198a180f6a5f37754f8ac0241ade6eca97b13650a59194fe9217f5fe7a6dcff0
7
+ data.tar.gz: 5798b3cb5c2241b6149784617dedd7c08c3ff6430621f0f38ca17c32ae6ea2fe5e7475d1babe433e8764442e9b7f26c439a91c2afe81ac39ad630d5242633bd0
File without changes
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ GemHadar do
11
11
  summary 'Library for the development of Ruby Gems'
12
12
  description 'This library contains some useful functionality to support the development of Ruby Gems'
13
13
  ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.bundle'
14
- readme 'README.rdoc'
14
+ readme 'README.md'
15
15
 
16
16
  dependency 'tins', '~>1.0'
17
17
  dependency 'sdoc', '~>0.3'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
data/gem_hadar.gemspec CHANGED
@@ -1,20 +1,20 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: gem_hadar 1.0.0 ruby lib
2
+ # stub: gem_hadar 1.1.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "gem_hadar"
6
- s.version = "1.0.0"
6
+ s.version = "1.1.0"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["Florian Frank"]
11
- s.date = "2014-02-06"
11
+ s.date = "2014-12-13"
12
12
  s.description = "This library contains some useful functionality to support the development of Ruby Gems"
13
13
  s.email = "flori@ping.de"
14
- s.extra_rdoc_files = ["README.rdoc", "lib/gem_hadar.rb", "lib/gem_hadar/version.rb"]
15
- s.files = [".gitignore", "Gemfile", "LICENSE", "README.rdoc", "Rakefile", "VERSION", "gem_hadar.gemspec", "lib/gem_hadar.rb", "lib/gem_hadar/version.rb"]
14
+ s.extra_rdoc_files = ["README.md", "lib/gem_hadar.rb", "lib/gem_hadar/version.rb"]
15
+ s.files = [".gitignore", "Gemfile", "LICENSE", "README.md", "Rakefile", "VERSION", "gem_hadar.gemspec", "lib/gem_hadar.rb", "lib/gem_hadar/version.rb"]
16
16
  s.homepage = "http://github.com/flori/gem_hadar"
17
- s.rdoc_options = ["--title", "GemHadar - Library for the development of Ruby Gems", "--main", "README.rdoc"]
17
+ s.rdoc_options = ["--title", "GemHadar - Library for the development of Ruby Gems", "--main", "README.md"]
18
18
  s.rubygems_version = "2.2.2"
19
19
  s.summary = "Library for the development of Ruby Gems"
20
20
 
@@ -22,20 +22,20 @@ Gem::Specification.new do |s|
22
22
  s.specification_version = 4
23
23
 
24
24
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- s.add_development_dependency(%q<gem_hadar>, ["~> 1.0.0"])
25
+ s.add_development_dependency(%q<gem_hadar>, ["~> 1.1.0"])
26
26
  s.add_development_dependency(%q<utils>, [">= 0"])
27
27
  s.add_runtime_dependency(%q<tins>, ["~> 1.0"])
28
28
  s.add_runtime_dependency(%q<sdoc>, ["~> 0.3"])
29
29
  s.add_runtime_dependency(%q<rake>, ["~> 10.0"])
30
30
  else
31
- s.add_dependency(%q<gem_hadar>, ["~> 1.0.0"])
31
+ s.add_dependency(%q<gem_hadar>, ["~> 1.1.0"])
32
32
  s.add_dependency(%q<utils>, [">= 0"])
33
33
  s.add_dependency(%q<tins>, ["~> 1.0"])
34
34
  s.add_dependency(%q<sdoc>, ["~> 0.3"])
35
35
  s.add_dependency(%q<rake>, ["~> 10.0"])
36
36
  end
37
37
  else
38
- s.add_dependency(%q<gem_hadar>, ["~> 1.0.0"])
38
+ s.add_dependency(%q<gem_hadar>, ["~> 1.1.0"])
39
39
  s.add_dependency(%q<utils>, [">= 0"])
40
40
  s.add_dependency(%q<tins>, ["~> 1.0"])
41
41
  s.add_dependency(%q<sdoc>, ["~> 0.3"])
@@ -1,6 +1,6 @@
1
1
  class GemHadar
2
2
  # GemHadar version
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/lib/gem_hadar.rb CHANGED
@@ -12,6 +12,8 @@ require 'rake/clean'
12
12
  require 'rake/testtask'
13
13
  require 'dslkit/polite'
14
14
  require 'set'
15
+ require 'pathname'
16
+ require 'erb'
15
17
  require 'gem_hadar/version'
16
18
  require_maybe 'simplecov'
17
19
  require_maybe 'rubygems/package_task'
@@ -30,7 +32,7 @@ class GemHadar
30
32
  end
31
33
  include Rake::DSL
32
34
  extend DSLKit::DSLAccessor
33
- include Spruz::SecureWrite
35
+ include Tins::SecureWrite
34
36
 
35
37
  def initialize(&block)
36
38
  @dependencies = []
@@ -383,7 +385,7 @@ EOT
383
385
  end
384
386
  end
385
387
 
386
- def write_ignore_file
388
+ def write_ignore_file
387
389
  secure_write('.gitignore') do |output|
388
390
  output.puts(ignore.sort)
389
391
  end
@@ -534,4 +536,44 @@ EOT
534
536
  end
535
537
  self
536
538
  end
539
+
540
+ class TemplateCompiler
541
+ include Tins::BlockSelf
542
+ include Tins::MethodMissingDelegator::DelegatorModule
543
+
544
+ def initialize(&block)
545
+ super block_self(&block)
546
+ @values = {}
547
+ instance_eval(&block)
548
+ end
549
+
550
+ def compile(src, dst)
551
+ template = File.read(src)
552
+ File.open(dst, 'w') do |output|
553
+ erb = ERB.new(template, nil, '-')
554
+ erb.filename = src.to_s
555
+ output.write erb.result binding
556
+ end
557
+ end
558
+
559
+ def method_missing(id, *a, &b)
560
+ if a.empty? && id && @values.key?(id)
561
+ @values[id]
562
+ elsif a.size == 1
563
+ @values[id] = a.first
564
+ else
565
+ super
566
+ end
567
+ end
568
+ end
569
+ end
570
+
571
+ def template(pathname, &block)
572
+ template_src = Pathname.new(pathname)
573
+ template_dst = template_src.sub_ext('') # ignore ext, we just support erb anyway
574
+ template_src == template_dst and raise ArgumentError,
575
+ "pathname #{pathname.inspect} needs to have a file extension"
576
+ file template_dst.to_s => template_src.to_s do
577
+ TemplateCompiler.new(&block).compile(template_src, template_dst)
578
+ end
537
579
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_hadar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-06 00:00:00.000000000 Z
11
+ date: 2014-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 1.1.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: utils
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ email: flori@ping.de
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files:
89
- - README.rdoc
89
+ - README.md
90
90
  - lib/gem_hadar.rb
91
91
  - lib/gem_hadar/version.rb
92
92
  files:
93
93
  - ".gitignore"
94
94
  - Gemfile
95
95
  - LICENSE
96
- - README.rdoc
96
+ - README.md
97
97
  - Rakefile
98
98
  - VERSION
99
99
  - gem_hadar.gemspec
@@ -107,7 +107,7 @@ rdoc_options:
107
107
  - "--title"
108
108
  - GemHadar - Library for the development of Ruby Gems
109
109
  - "--main"
110
- - README.rdoc
110
+ - README.md
111
111
  require_paths:
112
112
  - lib
113
113
  required_ruby_version: !ruby/object:Gem::Requirement