    # File lib/chef/knife/core/object_loader.rb, line 83
            def object_from_file(filename)
              case filename
              when /\.(js|json)$/
                r = Yajl::Parser.parse(IO.read(filename))

                # Chef::DataBagItem doesn't work well with the json_create method
                if @klass == Chef::DataBagItem
                  r
                else
                  @klass.json_create(r)
                end
              when /\.rb$/
                r = klass.new
                r.from_file(filename)
                r
              else
                ui.fatal("File must end in .js, .json, or .rb")
                exit 30
              end
            end