Browse Source

exist;release

Juergen 'eTM' Mangler 1 year ago
parent
commit
f0bbee264f
3 changed files with 11 additions and 11 deletions
  1. 8 8
      lib/cpee-frames/implementation.rb
  2. 1 1
      server/frames
  3. 2 2
      tools/cpee-frames

+ 8 - 8
lib/cpee-frames/implementation.rb

@@ -243,7 +243,7 @@ module CPEE
     class GetFrames < Riddl::Implementation #{{{
       def response
         fname = File.join('data',@r[-2],'frames.json')
-        if File.exists? fname
+        if File.exist? fname
 
           infofile = File.join('data',@r[-2],'info.json')
           infojson = JSON::parse(File.read(infofile))
@@ -279,7 +279,7 @@ module CPEE
         #puts @p[0].value
 
         #fname = File.join('data',@r[-2],'dataelements.json')
-        #if File.exists? fname
+        #if File.exist? fname
         #  Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
         #else
         #  @status = 404
@@ -290,7 +290,7 @@ module CPEE
     class GetDataElements < Riddl::Implementation #{{{
       def response
         fname = File.join('data',@r[-2],'dataelements.json')
-        if File.exists? fname
+        if File.exist? fname
           Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
         else
           @status = 404
@@ -301,7 +301,7 @@ module CPEE
     class GetInfo < Riddl::Implementation #{{{
       def response
         fname = File.join('data',@r[-2],'info.json')
-        if File.exists? fname
+        if File.exist? fname
           Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
         else
           @status = 404
@@ -312,7 +312,7 @@ module CPEE
     class GetLangs < Riddl::Implementation #{{{
       def response
         fname = File.join('data',@r[-2],'info.json')
-        if File.exists? fname
+        if File.exist? fname
           infojson = JSON::parse(File.read(fname))
           Riddl::Parameter::Complex.new('value','application/json',infojson["langs"])
         else
@@ -324,7 +324,7 @@ module CPEE
     class SetLang < Riddl::Implementation #{{{
       def response
         fname = File.join('data',@r[-2],'info.json')
-        if File.exists? fname
+        if File.exist? fname
           infojson = JSON::parse(File.read(fname))
           infojson["lang"] = @p[0].value
 
@@ -349,7 +349,7 @@ module CPEE
     class GetStyle < Riddl::Implementation #{{{
       def response
         fname = File.join('data',@r[-2],'style.url')
-        if File.exists? fname
+        if File.exist? fname
           Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
         else
           @status = 404
@@ -360,7 +360,7 @@ module CPEE
     class GetCpeeInstance < Riddl::Implementation #{{{
       def response
         fname = File.join('data',@r[-2],'cpeeinstance.url')
-        if File.exists? fname
+        if File.exist? fname
           Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
         else
           @status = 404

+ 1 - 1
server/frames

@@ -16,7 +16,7 @@
 # CPEE-FRAMES (file LICENSE in the main directory). If not, see
 # <http://www.gnu.org/licenses/>.
 
-if File.exists?(File.join(__dir__,'..','lib','cpee-frames','implementation.rb'))
+if File.exist?(File.join(__dir__,'..','lib','cpee-frames','implementation.rb'))
   require_relative File.join(__dir__,'..','lib','cpee-frames','implementation')
 else
   require 'cpee-frames/implementation'

+ 2 - 2
tools/cpee-frames

@@ -66,14 +66,14 @@ else
 end
 
 if command == 'new'
-  if !File.exists?(dir)
+  if !File.exist?(dir)
     FileUtils.cp_r(File.join(curpath,'..','server'),dir)
     FileUtils.mkdir(File.join(dir,'data')) rescue nil
   else
     puts 'Directory already exists.'
   end
 elsif command == 'newui'
-  if !File.exists?(dir)
+  if !File.exist?(dir)
     FileUtils.cp_r(File.join(curpath,'..','ui'),dir)
   else
     puts 'Directory already exists.'