<commit_before>noflo = require 'noflo'

request = require 'superagent'

Port      = noflo.Port
Component = noflo.Component

class MakeRequest extends Component
  constructor: ->
    @method = 'GET'

    @inPorts =
      in:    new Port 'string'
      method: new Port 'string'
    @outPorts =
      out: new Port 'object'

    @inPorts.method.on 'data', (@method) =>

    @inPorts.in.on 'data', (url) =>
      @outPorts.out.send request(@method, url)

    @inPorts.in.on 'disconnect', () =>
      @outPorts.out.disconnect()

exports.getComponent = -> new MakeRequest<commit_msg>reset `@method` after sending request to OUT and on `connect` to METHOD<commit_after>noflo = require 'noflo'

request = require 'superagent'

Port      = noflo.Port
Component = noflo.Component

class MakeRequest extends Component
  constructor: ->
    @method = 'GET'

    @inPorts =
      in:     new Port 'string'
      method: new Port 'string'
    @outPorts =
      out: new Port 'object'

    @inPorts.method.on 'connect', () =>
      @method = 'GET'

    @inPorts.method.on 'data', (@method) =>

    @inPorts.in.on 'data', (url) =>
      @outPorts.out.send request(@method, url)
      @method = 'GET'

    @inPorts.in.on 'disconnect', () =>
      @outPorts.out.disconnect()

exports.getComponent = -> new MakeRequest
{'fraction_non_alphanumeric': 0.14076923076923076, 'fraction_numerical': 0.0, 'mean_word_length': 2.895209580838323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5422977', 'n_tokens_mistral': 451, 'n_tokens_neox': 435, 'n_words': 108}