mirage 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/bin/mirage CHANGED
@@ -15,8 +15,10 @@ def start_mirage(args, mirage)
15
15
  end
16
16
 
17
17
  def mirage_process_ids
18
- mirage_cmdline_files = Dir['/proc/*/cmdline'].find_all { |cmdline_file| File.read(cmdline_file) =~ /Mirage Server|start_mirage/ }
19
- mirage_cmdline_files.collect{|mirage_cmdline_file| File.read("#{File.dirname(mirage_cmdline_file)}/stat").split(' ').first.to_i }
18
+ process_ids = []
19
+ process_ids << `ps aux | grep "Mirage Server" | grep -v grep`.split(' ')[1]
20
+ process_ids << `ps aux | grep "start_mirage" | grep -v grep`.split(' ')[1]
21
+ return process_ids.compact
20
22
  end
21
23
 
22
24
  if ARGV.include?('start')
@@ -42,9 +44,8 @@ elsif ARGV.include?('stop')
42
44
  begin
43
45
  mirage_process_ids.each do |id|
44
46
  puts "killing #{id}"
45
- Process.kill(9, id)
47
+ `kill -9 #{id}`
46
48
  end
47
-
48
49
  rescue
49
50
  puts 'Mirage is not running'
50
51
  end
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib")
2
2
  require 'rubygems'
3
- require 'bundler/setup'
4
- Bundler.setup(:test)
3
+ #require 'bundler/setup'
4
+ #Bundler.setup(:test)
5
5
  require 'mirage'
6
6
  require 'cucumber'
7
7
  require 'rspec'
@@ -36,12 +36,12 @@ end
36
36
 
37
37
  module Regression
38
38
  def stop_mirage
39
- `export RUBYOPT='' && cd #{SCRATCH} && mirage stop`
39
+ system "export RUBYOPT='' && cd #{SCRATCH} && mirage stop"
40
40
  end
41
41
 
42
42
  def start_mirage
43
- `truncate mirage.log --size 0`
44
- `export RUBYOPT='' && cd #{SCRATCH} && mirage start`
43
+ system "truncate mirage.log --size 0"
44
+ system "export RUBYOPT='' && cd #{SCRATCH} && mirage start"
45
45
  end
46
46
  end
47
47
 
@@ -57,7 +57,7 @@ module IntelliJ
57
57
 
58
58
  def start_mirage
59
59
  puts "starting mirage"
60
- `truncate mirage.log --size 0`
60
+ system "truncate mirage.log --size 0"
61
61
  system "cd #{SCRATCH} && ../bin/mirage start"
62
62
 
63
63
  wait_until do
@@ -81,8 +81,8 @@ Before do
81
81
  start_mirage
82
82
  end
83
83
 
84
- `cd #{SCRATCH}/ && ls | grep -v mirage.log | xargs rm -rf`
85
- `truncate -s 0 #{SCRATCH}/mirage.log`
84
+ system "cd #{SCRATCH}/ && ls | grep -v mirage.log | xargs rm -rf"
85
+ system "truncate -s 0 #{SCRATCH}/mirage.log"
86
86
  end
87
87
 
88
88
  at_exit do
@@ -89,7 +89,7 @@ then
89
89
  else
90
90
  run_build_for_ruby 'ruby-1.8.6'
91
91
  run_build_for_ruby 'ruby-1.8.7'
92
- run_build_for_ruby 'ruby-1.9.1'
92
+ run_build_for_ruby 'ruby-1.9.1-p378'
93
93
  run_build_for_ruby 'ruby-1.9.2'
94
94
  run_build_for_ruby 'jruby'
95
95
  fi
@@ -36,6 +36,9 @@ module Mirage
36
36
  # If a response is not found a ResponseNotFound exception is thrown
37
37
  #
38
38
  # Examples:
39
+ # Getting a response without any parameters or body content
40
+ # Mirage::Client.get(endpoint)
41
+ #
39
42
  # Getting a response, passing request parameters
40
43
  # Mirage::Client.new.get('greeting', :param1 => 'value1', param2=>'value2')
41
44
  #
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mirage'
3
- s.version = '1.0.2'
3
+ s.version = '1.1.0'
4
4
  s.authors = ["Leon Davis"]
5
5
  s.homepage = 'https://github.com/lashd/mirage'
6
6
  s.description = 'Mirage aids testing of your applications by hosting mock responses so that your applications do not have to talk to real endpoints. Its accessible via HTTP and has a RESTful interface.'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mirage
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Leon Davis
@@ -144,7 +144,7 @@ licenses: []
144
144
 
145
145
  post_install_message: "\n\
146
146
  ===============================================================================\n\
147
- Thanks you for installing mirage-1.0.2. \n\n\
147
+ Thanks you for installing mirage-1.1.0. \n\n\
148
148
  Run Mirage with:\n\n\
149
149
  mirage start \n\n\
150
150
  For more information go to: https://github.com/lashd/mirage/wiki\n\
@@ -171,7 +171,7 @@ rubyforge_project:
171
171
  rubygems_version: 1.6.1
172
172
  signing_key:
173
173
  specification_version: 3
174
- summary: mirage-1.0.2
174
+ summary: mirage-1.1.0
175
175
  test_files:
176
176
  - features/client/clear.feature
177
177
  - features/client/get.feature