OSDN Git Service

Merge branch 'v05' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v05
[pettanr/pettanr.git] / spec / cli / create.rb
1 if ARGV.size < 2\r
2   puts 'create.rb subdir controller {filename=create.json}'\r
3   exit\r
4 end\r
5 domain = 'http://localhost:3000'\r
6 user = ARGV[0].to_s\r
7 ctl = ARGV[1]\r
8 f = ARGV[2] ? ARGV[2].to_s+'_create' : 'create'\r
9 path = File.expand_path(File.dirname(__FILE__))\r
10 filename = path + "/#{user}/#{ctl}/#{f}.json"\r
11 \r
12 cmd = "curl -d @#{filename} #{domain}/#{ctl}.json  -X POST -H \"Content-Type: application/json\""\r
13 puts cmd\r
14 exec cmd\r