datadog-sdk-testing 0.1.1 → 0.2.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: 8cde3c433938f1f8a001a509fdb6687602e4bab5
4
- data.tar.gz: 3672eb25bb8903298bb677ba42d27f863bb7e9b7
3
+ metadata.gz: 3cf9017d51fc0316c48b723cba91e63e71bf4fe0
4
+ data.tar.gz: 15c6919d3984c52d84b66d0c3617dfb3d5d87f61
5
5
  SHA512:
6
- metadata.gz: 1e2439b013b57f0a2d2f45ef2ab3dcbc2086bb8cd2885693b62d26ea6e62c0303ffe3e2d6ccec22216a40a6547cfcc447e5bff43de814ff928c60c8883955329
7
- data.tar.gz: 5fc32b982e90ae3db30bf49bc73182b14fa8a3edce58693f9d2420660631aaf4314db40aefdcd0b35f157766f4e2dcf0bb5cf3ef41d0abd1536361fb0c5dc51d
6
+ metadata.gz: d61a36709b687ffefc33c5499c192a9338adef9294ced09662ffe89a793693c54f19d594611897a089822f1bafe25558abdf1a51b85c000eb7baa751fd9a6678
7
+ data.tar.gz: 8a1af63b9ab48149762fbf41153945e779fffecb35c48e536926bd0eccecc74f78d4ba52424c549eda4c46b2ab1cd3eccef80059fe016639b05fcbc1eea7182a
@@ -12,6 +12,14 @@ def check_env
12
12
  abort 'SDK_HOME env variable must be defined in your Rakefile to used this gem.' unless ENV['SDK_HOME']
13
13
  end
14
14
 
15
+ def sed(source, a, b, mods)
16
+ if RUBY_PLATFORM.include? 'darwin'
17
+ sh "sed -i '' \"s/#{a}/#{b}/#{mods}\" #{source}"
18
+ else
19
+ sh "sed -i \"s/#{a}/#{b}/#{mods}\" #{source}"
20
+ end
21
+ end
22
+
15
23
  def sleep_for(secs)
16
24
  puts "Sleeping for #{secs}s".blue
17
25
  sleep(secs)
@@ -7,7 +7,10 @@ require 'bundler'
7
7
 
8
8
  # Flavored Travis CI jobs
9
9
  require 'ci/default'
10
- Rake.add_rakelib './ci/'
10
+
11
+ Dir.glob("#{ENV['SDK_HOME']}/*/ci/").each do |f|
12
+ Rake.add_rakelib f
13
+ end
11
14
 
12
15
  CLOBBER.include '**/*.pyc'
13
16
 
@@ -91,21 +94,21 @@ namespace :generate do
91
94
  puts "generating skeleton files for #{args[:option]}"
92
95
  gem_home = Bundler.rubygems.find_name('datadog-sdk-testing').first.full_gem_path
93
96
  capitalized = args[:option].capitalize
94
- sh "mkdir -p #{ENV['SDK_HOME']}/ci"
95
- sh "mkdir -p #{ENV['SDK_HOME']}/#{args[:option]}"
96
- sh "cp #{gem_home}/lib/config/ci/skeleton.rake #{ENV['SDK_HOME']}/ci/#{args[:option]}.rake"
97
+ sh "mkdir -p #{ENV['SDK_HOME']}/#{args[:option]}/ci"
98
+ sh "cp #{gem_home}/lib/config/ci/skeleton.rake #{ENV['SDK_HOME']}/#{args[:option]}/ci/#{args[:option]}.rake"
97
99
  sh "cp #{gem_home}/lib/config/manifest.json #{ENV['SDK_HOME']}/#{args[:option]}/manifest.json"
98
100
  sh "cp #{gem_home}/lib/config/check.py #{ENV['SDK_HOME']}/#{args[:option]}/check.py"
99
101
  sh "cp #{gem_home}/lib/config/test_skeleton.py #{ENV['SDK_HOME']}/#{args[:option]}/test_#{args[:option]}.py"
100
102
  sh "cp #{gem_home}/lib/config/metadata.csv #{ENV['SDK_HOME']}/#{args[:option]}/metadata.csv"
101
103
  sh "cp #{gem_home}/lib/config/requirements.txt #{ENV['SDK_HOME']}/#{args[:option]}/requirements.txt"
102
104
  sh "cp #{gem_home}/lib/config/README.md #{ENV['SDK_HOME']}/#{args[:option]}/README.md"
103
- sh "find #{ENV['SDK_HOME']}/#{args[:option]} -type f -exec sed -i '' \"s/skeleton/#{args[:option]}/g\" {} \\;"
104
- sh "find #{ENV['SDK_HOME']}/#{args[:option]} -type f -exec sed -i '' \"s/Skeleton/#{capitalized}/g\" {} \\;"
105
- sh "sed -i '' \"s/skeleton/#{args[:option]}/g\" #{ENV['SDK_HOME']}/ci/#{args[:option]}.rake"
106
- sh "sed -i '' \"s/Skeleton/#{capitalized}/g\" #{ENV['SDK_HOME']}/ci/#{args[:option]}.rake"
107
- sh "git add #{ENV['SDK_HOME']}/ci/#{args[:option]}.rake"
108
- sh "git add #{ENV['SDK_HOME']}/#{args[:option]}/*"
105
+ Dir.glob("#{ENV['SDK_HOME']}/#{args[:option]}/**/*") do |f|
106
+ if File.file?(f)
107
+ sed(f, 'skeleton', "#{args[:option]}", 'g')
108
+ sed(f, 'Skeleton', "#{capitalized}", 'g')
109
+ end
110
+ end
111
+ sh "git add #{ENV['SDK_HOME']}/#{args[:option]}/"
109
112
 
110
113
  new_file = "#{ENV['SDK_HOME']}/circle.yml.new"
111
114
  File.open(new_file, 'w') do |fo|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-sdk-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Fullaondo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-21 00:00:00.000000000 Z
11
+ date: 2016-07-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Datadog Integration SDK testing/scaffolding gem
14
14
  email: jaime.fullaondo@datadoghq.com